argos/dmp-frontend/src/app/users/users.module.ts

67 lines
2.2 KiB
TypeScript
Raw Normal View History

2018-02-01 15:04:36 +01:00
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { UsersCriteriaComponent } from '../shared/components/criteria/users/users-criteria.component';
import { MaterialModule } from '../shared/material/material.module';
import { SharedModule } from '../shared/shared.module';
import { CommonModule } from '@angular/common';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { UsersComponent } from './components/users.component';
import { UserRoleEditorComponent } from './components/roles/user-role-editor.component';
2018-05-14 08:44:35 +02:00
import { RecentActivityComponent } from '../users/activity/recent-activity.component';
2018-05-28 11:50:42 +02:00
import { UserReferenceService } from '../services/user-reference/user-reference-data.service';
import { RouterModule } from '@angular/router';
import { UsersRoutes } from './users.routes';
import { BaseHttpModule } from '../utilities/cite-http-service-module/cite-http.module';
import { BaseHttpService } from '../utilities/cite-http-service-module/base-http.service';
2018-08-24 17:21:02 +02:00
import { UserProfileComponent } from './profile/user-profile.component';
2018-08-30 13:09:36 +02:00
import { TimezoneInfoDisplayPipe } from '../utilities/culture/pipes/TimezoneInfoDisplayPipe';
2018-02-01 15:04:36 +01:00
@NgModule({
2018-05-28 11:50:42 +02:00
imports: [
CommonModule,
SharedModule,
BaseHttpModule.forRoot(),
RouterModule.forChild(UsersRoutes),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
ReactiveFormsModule,
MaterialModule
],
declarations: [
UsersComponent,
UsersCriteriaComponent,
UserRoleEditorComponent,
2018-08-30 13:09:36 +02:00
UserProfileComponent,
TimezoneInfoDisplayPipe
2018-05-28 11:50:42 +02:00
],
providers: [
BaseHttpService,
UserReferenceService
],
exports: [
UsersComponent
]
2018-02-01 15:04:36 +01:00
})
export class UsersModule {
2018-05-28 11:50:42 +02:00
constructor(private translate: TranslateService) {
translate.setDefaultLang('en');
translate.use('en');
}
2018-02-01 15:04:36 +01:00
}
export function HttpLoaderFactory(httpClient: HttpClient) {
2018-05-28 11:50:42 +02:00
return new TranslateHttpLoader(httpClient, 'assets/lang/', '.json');
2018-02-01 15:04:36 +01:00
}