I am trying to use a link to dynamically translate a website.
This is my HTML:
<a ng-click="switchLanguage('{{language.value}}')" >Translate</a>
{{language.value}} is a dynamic value taken from a json file, and I can verify that at runtime it is populated with the proper value ('en-us', 'ja-jp', etc ...)
And here is my function inside the controller:
function switchLanguage(newlan) { console.log(newlan); }
However, every time I click on the link, the console displays the value as {{language.value}} instead of the correct value (for example: en-us).
How do I make a value inside ng-click pass the correct function parameter?
source share