JSON File Method
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
JSON File Loader
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
}
}),
AngularFirestore Method
export function FirestoreTranslationsLoaderFactory(db: AngularFirestore) {
return new FirestoreTransLoader(db);
}
AngularFirestore File Loader
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: FirestoreTranslationsLoaderFactory,
deps: [AngularFirestore]
}
}),
Note: I can't use two same time I try to merge in one method and Loader.