mardi 27 octobre 2015

ng-checked event for checkbox in AngularJS

I am trying to use ng-checked for checkbox under ng-repeat.

<div class="listing" ng-repeat="item in list>
<input type="checkbox" class="favor" ng-checked='::isFavorite(item)' ng-click='setFavorite(item)'/>
</div>

There is one method, which I am calling on ng-checked event. But, if there are 50 checkboxes in the list (i.e. 50 items in ng-repeat), then each time the page is drawn, the same method gets called twice an item. Any help would be really appreciable.!!




Aucun commentaire:

Enregistrer un commentaire