jeudi 20 octobre 2016

Angularjs three state checkbox with ng-repeat issue

I'm trying to get a list of questions (retrieved dynamically so we cant hard code them) and then using ng-repeat list them out with a three state checkbox next to each (true, false, null).

The code below works to show the questions with the correct checkboxes, however each time you click on 1 checkbox they all change as they are using the same ng-model (I assume).

How do I get around this?

Thanks

 <div class="select-all-checkboxes" flex="100" ng-repeat="(guidCustomerId,item) in items" ng-if="item.type=='Mandatory'" >
     <span three-state-checkbox ng-model="idv.checkboxModelThree" ng-change="idv.checkBoxonChange()" ng-checked="exists(item, selected_mandatory)"></span>
    <h8-red>   </h8-red>  <br /><br />
    </div>




Aucun commentaire:

Enregistrer un commentaire