Hello, you can find the code on the provided link.
This is the HTML snippet:
<div ng-app="testApp" ng-controller="myController">
<select name="current" id="current" ng-model="currentliga">
<option ng-repeat="liga in ligas">{{ liga }}</option>
</select>
{{ valor | currency:"R$" }}
</div>
Here is the JS code:
var app = angular.module('testApp', []);
app.controller('myController', function($scope){
$scope.ligas = ['Bronze', 'Silver', 'Gold', 'Platinum', 'Diamond'];
var price = $scope.currentliga;
switch(price){
case 'Bronze':
$scope.valor = 24;
break;
}
});
My intention with this code is to retrieve the value from $scope.currentLiga based on the selected option and then assign a corresponding value to "price," which will update the "valor" accordingly. For example, if someone selects 'Bronze,' the $scope.valor should be updated to 24. If you see any errors or have suggestions, please let me know! Thank you.