Reputation: 440
I have followed the Angular translation example and html page translation is working by calling with filter, say {{'TITLE' | xlat}}
I want to use the translation in JavaScript file. I tried calling $scope.xlat()
, $xlat()
or xlat()
.
How to refer and do the translation in JS file?
Upvotes: 0
Views: 558
Reputation: 2266
It should be probably:
$filter('xlat')('TITLE')
Also, remember that '$filter' must be injected.
Upvotes: 1