0
@NgModule({
    declaration: [...],   
    imports: [.., HeaderModule.forRoot({headerConfig: myHeaderConfig, ...})],
    providers: [...],
    bootstrap: [AppComponent]
})

This is how my app.module file is looking. I have to call a service to load myHeaderConfig values but till the time I receive service response, bootstraping of app is done without any header config. Is there any way to bootstrap app after a service call or any other idea? Any suggestion will be helpful.

1 Answers1

0

You can do this by using the APP_INITIALIZER construct to bootstrap your module. Look at my answer at Pass web application context to Angular2 Service

Ben Richards
  • 3,437
  • 1
  • 14
  • 18