Created
June 5, 2017 14:28
-
-
Save anteburazer/997ce2a2903c02594d30635509ea67d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { APP_INITIALIZER } from '@angular/core'; | |
export function configServiceFactory (config: ConfigService) { | |
return () => config.load() | |
} | |
... | |
@NgModule({ | |
... | |
providers: [ | |
... | |
ConfigService, | |
{ | |
provide: APP_INITIALIZER, | |
useFactory: configServiceFactory, | |
deps: [ConfigService], | |
multi: true | |
} | |
], | |
... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment