No ion-radio
has ng-value
with 2 values. The ng-model
is taking the value of ng-value
. The problem here is that I want to display these 2 values of ng-value
separated.
ex: {{data.nomeOpc}}
displays option name, and {{data.valorOpc}}
displays option value. In this model it displays the 2 together and I want to separate the values. Thanks for the help
<ion-list>
<h3>Opções</h3>
<ion-radio ng-repeat = "child in produto.opcoes" value = "{{child}}" ng-change = "pegar(data)" ng-model = "data.opcoes">
<strong>{{child.nomeOpc}}
<span> = {{child.valorOpc | currency: 'R$'}}</span>
</strong>
</ion-radio>
</ion-list>
Below is the function in the controller
$scope.pegar = function(data) {
$scope.data = JSON.parse(data.opcoes);
console.log($scope.data)
console.log($scope.data.id, $scope.data.nomeOpc);
}