import { NgModule, ErrorHandler, Injector } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatToolbarModule } from '@angular/material/toolbar'; import { WptButtonModule } from '@arrow/warpaint/button'; import { WptDialogModule } from '@arrow/warpaint/dialog'; import { WptFormFieldModule } from '@arrow/warpaint/form-field'; import { WptSelectModule } from '@arrow/warpaint/select'; // import ngx-config import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { HttpClient } from '@angular/common/http'; import { AppRouterModule } from './app-router.module'; import { LandingModule } from './landing/landing.module'; import { PageNotFoundComponent } from './page-not-found.component'; import { AppComponent } from './app.component'; import { GlobalErrorHandler } from './error-handler/error-handler.service'; import { ErrorDialogComponent } from './error-handler/error-dialog.component'; import { FeatureFlagRoutingModule } from '@arrow/bom/feature-flag'; import { RootStateModule } from './root-state/root-state.module'; import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; import { TIMESTAMP } from '../environments/environment'; import { CoreModule, DialogService } from '@arrow/bom/core'; @NgModule({ imports: [ BrowserModule, NoopAnimationsModule, FormsModule, MatToolbarModule, WptButtonModule, WptDialogModule, WptSelectModule, WptFormFieldModule, AppRouterModule, LandingModule, FeatureFlagRoutingModule, RootStateModule, CoreModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: (http: HttpClient) => new TranslateHttpLoader( http, '/i18n/messages.', `.json?cb=${TIMESTAMP}` ), deps: [HttpClient] }, compiler: { provide: TranslateCompiler, useClass: TranslateMessageFormatCompiler } }) ], declarations: [AppComponent, PageNotFoundComponent, ErrorDialogComponent], providers: [ { provide: ErrorHandler, useClass: GlobalErrorHandler }, DialogService ], entryComponents: [ErrorDialogComponent], bootstrap: [AppComponent] }) export class AppModule { }