54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
|
import { BaseHttpService } from '../utilities/cite-http-service-module/base-http.service';
|
||
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||
|
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
||
|
import { ProjectEditorComponent } from './editor/project-editor.component';
|
||
|
import { ProjectListingComponent } from './listing/project-listing.component';
|
||
|
import { ProjectRoutes } from './project.routes';
|
||
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||
|
import { CommonModule } from '@angular/common';
|
||
|
|
||
|
|
||
|
import { SharedModule } from '../shared/shared.module'
|
||
|
import { NgModule } from '@angular/core';
|
||
|
@NgModule({
|
||
|
imports: [
|
||
|
CommonModule,
|
||
|
FormsModule,
|
||
|
HttpClientModule,
|
||
|
SharedModule,
|
||
|
ProjectRoutes,
|
||
|
ReactiveFormsModule,
|
||
|
TranslateModule.forRoot({
|
||
|
loader: {
|
||
|
provide: TranslateLoader,
|
||
|
useFactory: HttpLoaderFactory,
|
||
|
deps: [HttpClient]
|
||
|
}
|
||
|
}),
|
||
|
],
|
||
|
|
||
|
declarations: [
|
||
|
ProjectListingComponent,
|
||
|
ProjectEditorComponent
|
||
|
],
|
||
|
|
||
|
exports: [
|
||
|
ProjectListingComponent,
|
||
|
ProjectEditorComponent,
|
||
|
], providers: [
|
||
|
BaseHttpService
|
||
|
]
|
||
|
})
|
||
|
|
||
|
export class ProjectsModule {
|
||
|
constructor(private translate: TranslateService) {
|
||
|
translate.setDefaultLang('en');
|
||
|
translate.use('en');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export function HttpLoaderFactory(httpClient: HttpClient) {
|
||
|
return new TranslateHttpLoader(httpClient, 'assets/lang/', '.json');
|
||
|
}
|