This repository has been archived by the owner on Jan 11, 2022. It is now read-only.
/
app.module.ts
58 lines (55 loc) · 1.77 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { APP_ID, Inject, NgModule, PLATFORM_ID } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';
import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to'
import { AppComponent } from './app.component';
import { CoreModule } from './core/core.module';
import { WorkbasketModule } from './workbasket/workbasket.module';
import { SearchModule } from './search/search.module';
import { routing } from './app.routing';
import { CasesModule } from './cases/cases.module';
import { AppConfig } from './app.config';
import { ErrorComponent } from './error/error.component';
import { SharedModule } from './shared/shared.module';
import { isPlatformBrowser } from '@angular/common';
import { OAuth2RedirectModule } from './oauth2/oauth2-redirect.module';
import { AppConfigGuard } from './app.config.guard';
import { AbstractAppConfig } from '@hmcts/ccd-case-ui-toolkit';
@NgModule({
imports: [
BrowserModule.withServerTransition({ appId: 'ccd-case-management-web' }),
HttpModule,
FormsModule,
routing,
ScrollToModule.forRoot(),
CoreModule,
WorkbasketModule,
SearchModule,
CasesModule,
SharedModule,
OAuth2RedirectModule,
],
declarations: [
AppComponent,
ErrorComponent
],
providers: [
AppConfig,
AppConfigGuard,
{
provide: AbstractAppConfig,
useExisting: AppConfig
}
],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(
@Inject(PLATFORM_ID) private platformId: Object,
@Inject(APP_ID) private appId: string) {
const platform = isPlatformBrowser(platformId) ?
'in the browser' : 'on the server';
console.log(`Running ${platform} with appId=${appId}`);
}
}