I am attempting to implement a dynamic translation feature on a website using a link.
Below is the HTML code I am using:
<a ng-click="switchLanguage('{{language.value}}')">Translate</a>
The value {{language.value}} is dynamically retrieved from a json file and I have confirmed that it is populated with the correct values ('en-us', 'ja-jp', etc...) during runtime.
Here is the function within my controller:
function switchLanguage(newlan) {
console.log(newlan);
}
However, when I click on the link, the console displays {{language.value}} instead of the actual value (e.g. en-us).
How can I ensure that the correct parameter is passed to the function within ng-click?