jeudi 2 juin 2016

Checkbox ng-model as variable from ng-repeat

I have categories list with checkboxes. I need to set ng-model as variable from ng-repeat. Filter works fine when I set ng-model manually. I tried many solutions but no one works in this case.

My angular version is 1.4.3

<ul ng-repeat="item in items>
   <li><input type="checkbox" ng-model="'setFilter.' + item.category"></li>
</ul>

<span ng-repeat = "product in products | filter:setFilter.category></span>




Aucun commentaire:

Enregistrer un commentaire