-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.module.ts
36 lines (31 loc) · 864 Bytes
/
app.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { BrowserModule } from '@angular/platform-browser';
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { HelloModule } from './hello/hello.module';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { AppConfigService } from './app-config.service';
export function initConfig(appConfigService: AppConfigService) {
return () => appConfigService.loadConfig();
}
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
HelloModule,
AppRoutingModule
],
providers: [
{
provide: APP_INITIALIZER,
useFactory: initConfig,
deps: [ AppConfigService ],
multi: true
}
],
bootstrap: [AppComponent]
})
export class AppModule { }