|
|
|
import {BrowserModule} from '@angular/platform-browser';
|
|
|
|
import {NgModule} from '@angular/core';
|
|
|
|
|
|
|
|
import {AppRoutingModule} from './app-routing.module';
|
|
|
|
// 主框架
|
|
|
|
import {AppComponent} from './app.component';
|
|
|
|
// 响应式表单
|
|
|
|
import {ReactiveFormsModule} from '@angular/forms';
|
|
|
|
// 国际化支持
|
|
|
|
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
|
|
|
|
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
|
|
|
|
// cookie
|
|
|
|
import {CookieService} from 'ngx-cookie-service';
|
|
|
|
// 异常处理组件
|
|
|
|
import {ErrorComponent} from './error/error.component';
|
|
|
|
// 账号管理模块
|
|
|
|
import {AccountModule} from './account/account/account.module';
|
|
|
|
// 论坛模块
|
|
|
|
import {ForumModule} from './forum/forum/forum.module';
|
|
|
|
// Http请求模块
|
|
|
|
import {HttpClient, HttpClientModule} from '@angular/common/http';
|
|
|
|
|
|
|
|
export function HttpLoaderFactory(http: HttpClient) {
|
|
|
|
return new TranslateHttpLoader(http);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 应用入口
|
|
|
|
*/
|
|
|
|
@NgModule({
|
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
|
|
|
ErrorComponent
|
|
|
|
],
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
AppRoutingModule,
|
|
|
|
ReactiveFormsModule,
|
|
|
|
AccountModule,
|
|
|
|
ForumModule,
|
|
|
|
HttpClientModule,
|
|
|
|
TranslateModule.forRoot({
|
|
|
|
loader: {
|
|
|
|
provide: TranslateLoader,
|
|
|
|
useFactory: HttpLoaderFactory,
|
|
|
|
deps: [HttpClient]
|
|
|
|
}
|
|
|
|
})
|
|
|
|
],
|
|
|
|
providers: [CookieService],
|
|
|
|
bootstrap: [AppComponent]
|
|
|
|
})
|
|
|
|
export class AppModule {
|
|
|
|
}
|