Search code examples
angulartypescriptsplash-screenangular2-bootstrapping

Is it possible to load some component before "App" component? Angular2


My application starts from App component:

@NgModule({
  bootstrap: [ App ]
...

This is my index.hmtl

...
<app>
 Loading...
</app>
...

But I want to make splash screen instead of just "Loading ... " message:

...
<app>
  <splash></splash>
</app>
...

Also I added splash screen to main module declarations:

...
declarations: [
  App,
  SplashScreen
],
...

But ... bootstrapping process starts from App component and Splash is not loaded. How can I load Splash component before App component and use it?


Solution

  • You can't load a component without Angular, so you probably need to make a "static" splash screen/loading animation with pure HTML (and JS, if you need that).