import { BrowserModule } from '@angular/platform-browser' ; import { NgModule } from '@angular/core' ; import { FormsModule } from '@angular/forms' ; import { TranslateModule , TranslateLoader } from '@ngx-translate/core' ; import { TranslateHttpLoader } from '@ngx-translate/http-loader' ; import { AppComponent } from './app.component' ; import { AppRoutingModule } from './app-routing.module' ; import { HomeModule } from './home/home.module' ; import { UsersModule } from './users/users.module' ; import { HttpClient , HttpClientModule } from '@angular/common/http' ; export function HttpLoaderFactory ( http ) { return new TranslateHttpLoader ( http , '/assets/locales/' , '.json' ) ; } @ NgModule ( { declarations : [ AppComponent ] , imports : [ BrowserModule , HttpClientModule , FormsModule , TranslateModule . forRoot ( { loader : { provide : TranslateLoader , useFactory : HttpLoaderFactory , deps : [ HttpClient ] } } ) , HomeModule , UsersModule , AppRoutingModule ] , bootstrap : [ AppComponent ] } ) export class AppModule { }