I'm using ngx-translate with no-problems in views, using pipes. What i need to do is to use it in a component, for example to show an error message, or define a datatable column default content.
I'm trying to do something like:
translate.instant("AREA.NEW");
or
translate.get("AREA.NEW").subscribe((res: string) => {
console.log(res);
});
I've tried calling it in ngOnInit() and ngAfterViewInit()
But in both cases i just get "AREA.NEW", not the translated word. I asume the json dictionary is loaded after my call, so i don't realize how make it work.