Skip to content

Instantly share code, notes, and snippets.

@bodrovis bodrovis/tab1.page.ts
Last active Dec 27, 2018

Embed
What would you like to do?
// other stuff...
export class Tab1Page {
private language: string = this.translateService.currentLang;
private someProperty: string = ''; // 1
constructor(private translateService: TranslateService) {
this.translateService.setTranslation('en', { // 2
'tab1.getStarted': 'Get Started', // add this
'someProperty': 'We can use translations in {{var}}' // 3
}); // add this
this.translateService.get('someProperty', { var: 'classes' }).subscribe((res: string) => { // 4
this.someProperty = res; // 5
}); // add this
}
languageChange() {
this.translateService.use(this.language);
}
}
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.