-
Notifications
You must be signed in to change notification settings - Fork 666
/
app.module.ts
85 lines (76 loc) · 2.6 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { NgModule, LOCALE_ID, APP_INITIALIZER } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateModule } from '@ngx-translate/core';
// angular i18n
import { registerLocaleData } from '@angular/common';
import localeZh from '@angular/common/locales/zh';
registerLocaleData(localeZh);
import { environment } from '../environments/environment';
import { SharedModule } from './shared/shared.module';
import { RoutesModule } from './routes/routes.module';
import { ALAIN_I18N_TOKEN } from '@delon/theme';
import { I18NService } from './core/i18n/service';
import { CoreModule } from './core/core.module';
import { StartupService } from './core/startup.service';
import { AppComponent } from './app.component';
import { LayoutComponent } from './layout/layout.component';
import { HeaderComponent } from './layout/header/header.component';
import { FooterComponent } from './layout/footer/footer.component';
import { DelonModule } from './delon.module';
import { JsonSchemaModule } from './shared/json-schema/json-schema.module';
import { NgxTinymceModule } from 'ngx-tinymce';
import { UEditorModule } from 'ngx-ueditor';
import { SimplemdeModule } from 'ngx-simplemde';
export function StartupServiceFactory(
startupService: StartupService,
): Function {
return () => startupService.load();
}
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
CoreModule,
DelonModule.forRoot(),
SharedModule,
JsonSchemaModule,
RoutesModule,
// i18n
TranslateModule.forRoot(),
NgxTinymceModule.forRoot({
baseURL: 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.7.13/',
}),
UEditorModule.forRoot({
// **注:** 建议使用本地路径;以下为了减少 ng-alain 脚手架的包体大小引用了CDN,可能会有部分功能受影响
js: [
`//apps.bdimg.com/libs/ueditor/1.4.3.1/ueditor.config.js`,
`//apps.bdimg.com/libs/ueditor/1.4.3.1/ueditor.all.min.js`,
],
options: {
UEDITOR_HOME_URL: `//apps.bdimg.com/libs/ueditor/1.4.3.1/`,
},
}),
SimplemdeModule.forRoot({
delay: 300
})
],
providers: [
{ provide: ALAIN_I18N_TOKEN, useClass: I18NService, multi: false },
StartupService,
{
provide: APP_INITIALIZER,
useFactory: StartupServiceFactory,
deps: [StartupService],
multi: true,
},
],
declarations: [
AppComponent,
LayoutComponent,
HeaderComponent,
FooterComponent,
],
bootstrap: [AppComponent],
})
export class AppModule {}