I would need to display different prices for the same item depending on the currency chosen by the user (the different prices are already provided from the backend, so there is no need to do any further conversion). I would like to change the expression with ng-click
My html goes like this:
<div ng-controller="myCtrl">
you have, {{exchange.[currency]}}...
<br>
<br>
<select>
<option ngclick="currency='USD'">USD</option>
<option ngclick="currency='Eur'">Eur</option>
</select>
</div>
And my controller:
var app = angular.module('myApp', []);
// controller here
app.controller('myCtrl', function($scope) {
$scope.currency = "USD";
$scope.exchange = [{
"USD": 199,
"Eur": 20
}];
})
You can check the code above in a JSfiddle here