import { NgModule } from '@angular/core' ; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ; import { Http , HttpModule } from '@angular/http' ; import { TranslateModule , TranslateLoader } from '@ngx-translate/core' ; import { TranslateHttpLoader } from '@ngx-translate/http-loader' ; import { Config } from './common/index' ; import { AppComponent } from './app.component' ; import { SHARED_MODULES } from './app.common' ; Config . PLATFORM_TARGET = Config . PLATFORMS . WEB ; export function createTranslateLoader ( http ) { return new TranslateHttpLoader ( < any > http , './assets/i18n/' , '.json' ) ; } @ NgModule ( { declarations : [ AppComponent ] , imports : [ BrowserAnimationsModule , HttpModule , TranslateModule . forRoot ( { loader : { provide : TranslateLoader , useFactory : ( createTranslateLoader ) , deps : [ Http ] } } ) , ... SHARED_MODULES ] , providers : [ ] , bootstrap : [ AppComponent ] } ) export class AppModule { }