Using selectTranslate with scope is not working in component ts file when translation files are placed in library
BVSureshBabu opened this issue · comments
BVSureshBabu commented
Hi,
I am trying to use translocoService.selectTranslate in component but it is not working if I place translation files in library. I used below syntax in location-a.component.ts file. Please help me on the same.
this.translocoService.selectTranslate('cc.gpsa',{},'en').subscribe(result => {
console.log("Translation is ",result);
})
Thanks,
Suresh Babu
BVSureshBabu commented
Hi,
Using below syntax I am able to translate in component.
constructor(private translocoService: TranslocoService, @Inject(TRANSLOCO_SCOPE) private scope) {}
ngOnInit() {
this.translocoService.selectTranslate('gpsa',{},this.scope).subscribe(result => {
console.log("Translation is ",result);
})
}
Thanks,
Suresh