Repository navigation
Expand file tree
/
Copy pathroot.module.ts
More file actions
61 lines (54 loc) · 1.99 KB
/
Copy pathroot.module.ts
File metadata and controls
61 lines (54 loc) · 1.99 KB
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
59
60
61
import { NgModule, APP_INITIALIZER, LOCALE_ID } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { ModalModule } from 'ngx-bootstrap/modal';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { CollapseModule } from 'ngx-bootstrap/collapse';
import { TabsModule } from 'ngx-bootstrap/tabs';
import { AbpHttpInterceptor } from 'abp-ng2-module';
import { SharedModule } from '@shared/shared.module';
import { ServiceProxyModule } from '@shared/service-proxies/service-proxy.module';
import { RootRoutingModule } from './root-routing.module';
import { AppConsts } from '@shared/AppConsts';
import { API_BASE_URL } from '@shared/service-proxies/service-proxies';
import { RootComponent } from './root.component';
import { AppInitializer } from './app-initializer';
export function getCurrentLanguage(): string {
if (abp.localization.currentLanguage.name) {
return abp.localization.currentLanguage.name;
}
// todo: Waiting for https://github.com/angular/angular/issues/31465 to be fixed.
return 'en';
}
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
SharedModule.forRoot(),
ModalModule.forRoot(),
BsDropdownModule.forRoot(),
CollapseModule.forRoot(),
TabsModule.forRoot(),
ServiceProxyModule,
RootRoutingModule,
],
declarations: [RootComponent],
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: AbpHttpInterceptor, multi: true },
{
provide: APP_INITIALIZER,
useFactory: (appInitializer: AppInitializer) => appInitializer.init(),
deps: [AppInitializer],
multi: true,
},
{ provide: API_BASE_URL, useFactory: () => AppConsts.remoteServiceBaseUrl },
{
provide: LOCALE_ID,
useFactory: getCurrentLanguage,
},
],
bootstrap: [RootComponent],
})
export class RootModule {}