2022-02-03 11:33:57 +01:00
|
|
|
import { CommonModule } from '@angular/common';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
2022-02-03 10:45:09 +01:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { FormsModule } from '@angular/forms';
|
2020-04-22 12:56:18 +02:00
|
|
|
import { BrowserModule, Title } from '@angular/platform-browser';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
2019-10-01 16:39:29 +02:00
|
|
|
import {
|
2020-04-21 10:50:26 +02:00
|
|
|
MissingTranslationHandler,
|
|
|
|
MissingTranslationHandlerParams,
|
|
|
|
TranslateLoader,
|
|
|
|
TranslateModule,
|
|
|
|
TranslateService,
|
2019-10-01 16:39:29 +02:00
|
|
|
} from '@ngx-translate/core';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
|
|
import { ClipboardModule } from 'ngx-clipboard';
|
|
|
|
import { MarkdownModule } from 'ngx-markdown';
|
2020-04-22 12:56:18 +02:00
|
|
|
import { NgxWebstorageModule } from 'ngx-webstorage';
|
2019-11-22 10:18:09 +01:00
|
|
|
|
2020-04-22 12:56:18 +02:00
|
|
|
import { environment } from '../environments/environment';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { AppRoutingModule } from './app-routing.module';
|
|
|
|
import { AppComponent } from './app.component';
|
2020-04-22 12:56:18 +02:00
|
|
|
import { CoreModule } from './core/core.module';
|
|
|
|
import { SharedModule } from './shared/shared.module';
|
2021-02-04 18:54:30 +01:00
|
|
|
import { CguComponent } from './features/shared/components/ui/static-pages/cgu/cgu.component';
|
|
|
|
import { LegalComponent } from './features/shared/components/ui/static-pages/legal/legal.component';
|
|
|
|
import { PrivacyComponent } from './features/shared/components/ui/static-pages/privacy/privacy.component';
|
2021-02-08 11:32:58 +01:00
|
|
|
import { CipheringComponent } from './features/shared/components/ui/static-pages/ciphering/ciphering.component';
|
2021-05-04 09:33:28 +02:00
|
|
|
import { ErrorsListComponent } from './features/shared/components/ui/form/errors-list/errors-list.component';
|
2021-05-18 13:34:28 +02:00
|
|
|
import { KeyboardShortcutsModule } from 'ng-keyboard-shortcuts';
|
|
|
|
import { AdministrationModule } from './features/administration/administration.module';
|
2022-02-07 16:12:32 +01:00
|
|
|
import { ChoiceButtonDinumComponent } from './features/shared/components/choice-button-dinum/choice-button-dinum.component';
|
2022-02-08 14:37:07 +01:00
|
|
|
import { StaticPagesComponent } from './features/shared/static-pages/static-pages.component';
|
2022-02-03 10:45:09 +01:00
|
|
|
|
2019-10-01 16:39:29 +02:00
|
|
|
export class MyMissingTranslationHandler implements MissingTranslationHandler {
|
2020-04-22 12:56:18 +02:00
|
|
|
public handle(params: MissingTranslationHandlerParams): string {
|
|
|
|
return `MISSING TRANSLATION FOR [${params.key}]`;
|
2020-04-21 10:50:26 +02:00
|
|
|
}
|
2019-10-01 16:39:29 +02:00
|
|
|
}
|
2019-08-12 14:40:33 +02:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
2022-02-03 11:16:28 +01:00
|
|
|
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
2019-10-01 15:43:37 +02:00
|
|
|
}
|
2019-08-09 13:38:51 +02:00
|
|
|
|
|
|
|
@NgModule({
|
2022-02-08 14:37:07 +01:00
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
|
|
|
CguComponent,
|
|
|
|
LegalComponent,
|
|
|
|
PrivacyComponent,
|
|
|
|
CipheringComponent,
|
|
|
|
StaticPagesComponent,
|
|
|
|
],
|
2020-04-21 10:50:26 +02:00
|
|
|
imports: [
|
2020-04-22 12:56:18 +02:00
|
|
|
AppRoutingModule,
|
2021-05-18 13:34:28 +02:00
|
|
|
AdministrationModule,
|
2020-04-22 12:56:18 +02:00
|
|
|
BrowserAnimationsModule,
|
|
|
|
BrowserModule,
|
2020-04-21 10:50:26 +02:00
|
|
|
ClipboardModule,
|
|
|
|
CommonModule,
|
2020-04-22 12:56:18 +02:00
|
|
|
CoreModule,
|
|
|
|
FormsModule,
|
|
|
|
HttpClientModule,
|
2021-05-18 13:34:28 +02:00
|
|
|
KeyboardShortcutsModule.forRoot(),
|
2020-04-21 10:50:26 +02:00
|
|
|
MarkdownModule.forRoot(),
|
2020-04-22 12:56:18 +02:00
|
|
|
NgxWebstorageModule.forRoot({ prefix: environment.localStorage.key }),
|
|
|
|
SharedModule,
|
2020-04-21 10:50:26 +02:00
|
|
|
TranslateModule.forRoot({
|
2022-02-03 10:45:09 +01:00
|
|
|
defaultLanguage: environment.defaultLanguage,
|
2020-04-21 10:50:26 +02:00
|
|
|
loader: {
|
|
|
|
provide: TranslateLoader,
|
|
|
|
useFactory: HttpLoaderFactory,
|
|
|
|
deps: [HttpClient],
|
|
|
|
},
|
2020-04-22 12:56:18 +02:00
|
|
|
missingTranslationHandler: {
|
|
|
|
provide: MissingTranslationHandler,
|
|
|
|
useClass: MyMissingTranslationHandler,
|
|
|
|
},
|
2020-11-05 14:39:01 +01:00
|
|
|
useDefaultLang: true,
|
2020-04-21 10:50:26 +02:00
|
|
|
}),
|
|
|
|
],
|
2020-06-12 19:17:39 +02:00
|
|
|
providers: [Title, TranslateService],
|
2020-04-21 10:50:26 +02:00
|
|
|
bootstrap: [AppComponent],
|
2022-02-07 16:12:32 +01:00
|
|
|
exports: [ErrorsListComponent, ChoiceButtonDinumComponent],
|
2019-08-09 13:38:51 +02:00
|
|
|
})
|
2020-04-14 11:28:33 +02:00
|
|
|
export class AppModule {}
|