2019-08-09 17:43:23 +02:00
|
|
|
import {BrowserModule} from '@angular/platform-browser';
|
2019-11-23 14:30:19 +01:00
|
|
|
import {NgModule} from '@angular/core';
|
2019-08-09 13:38:51 +02:00
|
|
|
|
2019-08-09 17:43:23 +02:00
|
|
|
import {AppRoutingModule} from './app-routing.module';
|
|
|
|
import {AppComponent} from './app.component';
|
2019-08-10 16:57:36 +02:00
|
|
|
import {BaseComponent} from './pages/base-page/base.component';
|
|
|
|
import {KindComponent} from './pages/kind/kind.component';
|
2019-08-09 17:43:23 +02:00
|
|
|
import {HeaderComponent} from './header/header.component';
|
2019-08-09 15:14:23 +02:00
|
|
|
import {FormsModule} from '@angular/forms';
|
2019-08-09 17:43:23 +02:00
|
|
|
import {NavigationComponent} from './ui/navigation/navigation.component';
|
|
|
|
import {RouterModule} from '@angular/router';
|
|
|
|
import {Routes} from './config/Routes';
|
2019-10-03 11:48:13 +02:00
|
|
|
import {CommonModule, registerLocaleData} from '@angular/common';
|
|
|
|
import {DatesComponent} from './pages/dates/dates.component';
|
|
|
|
import {DebuggerComponent} from './debugger/debugger.component';
|
|
|
|
import {VisibilityComponent} from './pages/visibility/visibility.component';
|
|
|
|
import {ResumeComponent} from './pages/resume/resume.component';
|
|
|
|
import {PicturesComponent} from './pages/pictures/pictures.component';
|
|
|
|
import {AnswersComponent} from './pages/answers/answers.component';
|
|
|
|
import {EndConfirmationComponent} from './pages/end-confirmation/end-confirmation.component';
|
|
|
|
import {CreateOrRetrieveComponent} from './pages/create-or-retrieve/create-or-retrieve.component';
|
2019-08-12 14:40:33 +02:00
|
|
|
import localeFr from '@angular/common/locales/fr';
|
2019-10-01 16:52:36 +02:00
|
|
|
import localeEn from '@angular/common/locales/en';
|
2019-10-03 11:48:13 +02:00
|
|
|
import {VotingSummaryComponent} from './pages/voting-summary/voting-summary.component';
|
|
|
|
import {VotingGraphComponent} from './pages/voting-graph/voting-graph.component';
|
|
|
|
import {VotingChoiceComponent} from './pages/voting-choice/voting-choice.component';
|
|
|
|
import {PasswordComponent} from './pages/password/password.component';
|
|
|
|
import {HomeComponent} from './pages/home/home.component';
|
|
|
|
import {VoteChoiceComponent} from './vote-choice/vote-choice.component';
|
2019-10-01 15:43:37 +02:00
|
|
|
import {HttpClient, HttpClientModule} from '@angular/common/http';
|
2019-11-23 14:30:19 +01:00
|
|
|
import {MarkdownModule} from 'ngx-markdown';
|
2019-10-01 16:39:29 +02:00
|
|
|
import {
|
|
|
|
MissingTranslationHandler,
|
|
|
|
MissingTranslationHandlerParams,
|
|
|
|
TranslateLoader,
|
|
|
|
TranslateModule,
|
|
|
|
TranslateService
|
|
|
|
} from '@ngx-translate/core';
|
2019-10-01 15:43:37 +02:00
|
|
|
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
|
2019-11-23 14:30:19 +01:00
|
|
|
import {PollGraphicComponent} from './poll-graphic/poll-graphic.component';
|
2019-11-22 10:18:09 +01:00
|
|
|
|
2019-11-23 14:30:19 +01:00
|
|
|
import {AdminComponent} from './pages/admin/admin.component';
|
|
|
|
import {SelectorComponent} from './ui/selector/selector.component';
|
2019-08-12 14:40:33 +02:00
|
|
|
|
2019-10-01 16:39:29 +02:00
|
|
|
export class MyMissingTranslationHandler implements MissingTranslationHandler {
|
|
|
|
handle(params: MissingTranslationHandlerParams) {
|
|
|
|
return 'some value';
|
|
|
|
}
|
|
|
|
}
|
2019-08-12 14:40:33 +02:00
|
|
|
|
|
|
|
registerLocaleData(localeFr, 'fr');
|
2019-10-01 16:52:36 +02:00
|
|
|
registerLocaleData(localeEn, 'en');
|
2019-08-09 13:38:51 +02:00
|
|
|
|
2019-10-01 15:43:37 +02:00
|
|
|
export function HttpLoaderFactory(http: HttpClient) {
|
|
|
|
return new TranslateHttpLoader(http);
|
|
|
|
}
|
2019-08-09 13:38:51 +02:00
|
|
|
|
|
|
|
@NgModule({
|
2019-10-03 11:48:13 +02:00
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
|
|
|
BaseComponent,
|
|
|
|
KindComponent,
|
|
|
|
HeaderComponent,
|
|
|
|
NavigationComponent,
|
|
|
|
DatesComponent,
|
|
|
|
DebuggerComponent,
|
|
|
|
VisibilityComponent,
|
|
|
|
ResumeComponent,
|
|
|
|
PicturesComponent,
|
|
|
|
AnswersComponent,
|
|
|
|
EndConfirmationComponent,
|
|
|
|
CreateOrRetrieveComponent,
|
|
|
|
VotingSummaryComponent,
|
|
|
|
VotingGraphComponent,
|
|
|
|
VotingChoiceComponent,
|
|
|
|
PasswordComponent,
|
|
|
|
HomeComponent,
|
2019-10-23 10:45:30 +02:00
|
|
|
PollGraphicComponent,
|
2019-10-03 11:48:13 +02:00
|
|
|
VoteChoiceComponent,
|
2019-11-18 19:32:14 +01:00
|
|
|
AdminComponent,
|
2019-11-23 14:30:19 +01:00
|
|
|
SelectorComponent,
|
2019-08-09 15:14:23 +02:00
|
|
|
|
2019-10-03 11:48:13 +02:00
|
|
|
],
|
|
|
|
imports: [
|
|
|
|
CommonModule,
|
|
|
|
BrowserModule,
|
|
|
|
AppRoutingModule,
|
2019-10-23 16:04:59 +02:00
|
|
|
MarkdownModule.forRoot(),
|
2019-10-01 15:43:37 +02:00
|
|
|
TranslateModule.forRoot({
|
2019-10-01 16:39:29 +02:00
|
|
|
missingTranslationHandler: {
|
|
|
|
provide: MissingTranslationHandler,
|
|
|
|
useClass: MyMissingTranslationHandler,
|
|
|
|
},
|
2019-10-01 16:52:36 +02:00
|
|
|
// useDefaultLang: false,
|
2019-10-01 15:43:37 +02:00
|
|
|
loader: {
|
|
|
|
provide: TranslateLoader,
|
|
|
|
useFactory: HttpLoaderFactory,
|
|
|
|
deps: [HttpClient]
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
HttpClientModule,
|
2019-10-03 11:48:13 +02:00
|
|
|
FormsModule,
|
|
|
|
RouterModule.forRoot(Routes)
|
|
|
|
],
|
2019-10-01 15:43:37 +02:00
|
|
|
providers: [TranslateService],
|
2019-10-03 11:48:13 +02:00
|
|
|
bootstrap: [AppComponent]
|
2019-08-09 13:38:51 +02:00
|
|
|
})
|
2019-08-09 17:43:23 +02:00
|
|
|
export class AppModule {
|
|
|
|
}
|