0

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?

1 Answer 1

1

It should be probably:

$filter('xlat')('TITLE')

Also, remember that '$filter' must be injected.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.