Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ngx-translate load from object map, key/value
import { Observable } from 'rxjs/Observable';
const translations: any = {
'stage_headline' : 'hello'
};
class MappedDataLoader implements TranslateLoader {
getTranslation(lang: string): Observable<any> {
return Observable.of(translations);
}
}
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useClass: MappedDataLoader
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.