i am trying to push an ng-model value inside an ng-controller array, using the input box.
It seems that when i check the box the ng-model propriety change:
HERE THE PROBLEM
I just want that ng-model propriety won't change when the input is checked, here my code
json model
[
{
"nomeservizio" : "Frameworks",
"framewrok":[
{
"name":"nessuno",
"costo": 40
},
{
"name":"bootstrap",
"costo": 0
}
]
}]
HTML
<div class="row" ng-repeat="voce in voices.data">
<h4 style="color:#000;">{{voce.nomeservizio}}</h4>
<div ng-repeat="cssframework in voce.framewrok">
<input type="checkbox" ng-model="cssframework.costo" ng-change="AggiornaTotale({{cssframework.costo}})"/>
<span>{{cssframework.name}}........<b>{{cssframework.costo | currency}}</b></span>
</div>
</div>
<div class="row">
<h3>TOTALE: {{selectedVoices}}</h3>
</div>
JS INSIDE CONTROLLER
$scope.AggiornaTotale = function(param) {
$scope.selectedVoices = [];
$scope.selectedVoices.push(param);
}



ng-modelon a checkbox is not the same as the value for that checkbox. It is used to track thecheckedstate. Yourcostoproperties contain values