Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
app module with app initilizer
export function init_app(appLoadService: AppInitService) {
return () => appLoadService.init();
}
@NgModule({
declarations: [AppComponent, ComponentAComponent, ComponentBComponent],
imports: [BrowserModule, CoreModule, HttpClientModule],
providers: [
AppInitService,
{
provide: APP_INITIALIZER,
useFactory: init_app,
deps: [AppInitService],
multi: true
}
],
bootstrap: [AppComponent]
})
export class AppModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.