Created
September 21, 2017 14:14
-
-
Save Tuizi/af8272a28d4e837875bcc0118df0d7e6 to your computer and use it in GitHub Desktop.
This file contains 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
@Component({ | |
selector: 'i-home', | |
templateUrl: './home.component.html', | |
styleUrls: ['./home.component.scss'] | |
}) | |
export class HomeComponent implements OnInit { | |
lang$: Observable<string>; | |
constructor(private readonly translate: TranslateService, | |
private readonly store: Store<fromRoot.State>) { | |
this.translate.setDefaultLang('en'); | |
this.lang$ = this.store.select(fromRoot.getCurrentLanguage); | |
} | |
ngOnInit() { | |
this.lang$.subscribe(lang => this.translate.use(lang)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment