dimanche 19 février 2017

Angular js input box how to pass ng-model without change it?

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

enter image description here

enter image description here

enter image description here

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;"></h4>
    <div ng-repeat="cssframework in voce.framewrok">
        <input type="checkbox" ng-model="cssframework.costo"  ng-change="AggiornaTotale()"/>  
        <span>........<b></b></span>
    </div>  
</div>

<div class="row">
    <h3>TOTALE: </h3>
</div>

JS INSIDE CONTROLLER

    $scope.AggiornaTotale = function(param) {
    $scope.selectedVoices = [];
    $scope.selectedVoices.push(param);
}   




Aucun commentaire:

Enregistrer un commentaire