Last active
September 21, 2017 14:12
-
-
Save Tuizi/f26b4a390cb8d9737170e0a319edb365 to your computer and use it in GitHub Desktop.
ngx-translate multiple i18n files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function createTranslateLoader(http: HttpClient) { | |
return new TranslateHttpLoader(http, './assets/i18n/app/', '.json'); | |
} | |
@NgModule({ | |
imports: [ | |
/* ... */ | |
HttpClientModule, | |
TranslateModule.forRoot({ | |
loader: { | |
provide: TranslateLoader, | |
useFactory: (createTranslateLoader), | |
deps: [HttpClient] | |
}, | |
isolate: true | |
}) | |
] | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment