import { NgModule , APP_INITIALIZER } from '@angular/core' ; import { BrowserModule } from '@angular/platform-browser' ; import { HttpModule } from '@angular/http' ; import { HelpersService } from './core/services' ; import { StartupService } from './services/startup.service' ; import { CoreModule } from './core/core.module' ; import { SharedModule } from './shared/shared.module' ; import { MoviesModule } from './movies/movies.module' ; import { AppComponent } from './app.component' ; import { AppRoutingModule } from './app.routing' ; import '../styles/styles.scss' ; export function startServiceFactory ( ss ) { return ( ) => ss . load ( ) ; } @ NgModule ( { imports : [ BrowserModule , HttpModule , AppRoutingModule , MoviesModule , SharedModule , CoreModule ] , declarations : [ AppComponent ] , bootstrap : [ AppComponent ] , providers : [ StartupService , { provide : APP_INITIALIZER , useFactory : startServiceFactory , deps : [ StartupService ] , multi : true } ] } ) export class AppModule { }