javascript - Use ngx-translate in component -


i'm using ngx-translate no-problems in views, using pipes. need use in component, example show error message, or define datatable column default content.

i'm trying like:

translate.instant("area.new"); 

or

translate.get("area.new").subscribe((res: string) => {     console.log(res); }); 

i've tried calling in ngoninit() , ngafterviewinit()

but in both cases "area.new", not translated word. asume json dictionary loaded after call, don't realize how make work.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -