I am working with an Ionic application and encountering a minor issue, much like AngularJS.
<ion-list class="list-inset subcategory" ng-repeat="item in shops">
<ion-checkbox class="item item-divider item-checkbox-right" ng-model="selectAll">
{{item}}
</ion-checkbox>
<ion-item ng-repeat="value in data | filter:{shopName: item}" class="item-thumbnail-left" ng-click="openProduct(value)">
...
<div class="row">
<ion-checkbox stop-event='click' ng-model="value.selected" ng-checked="selectAll">{{value.name}}</ion-checkbox>
</div>
...
</ion-list>
Clicking on the item with ng-model="selectAll"
selects all items. However, I am facing an issue with the property value.selected
. It is set to false for each individual value. When I click on an item with ng-model="value.selected"
, it changes. But when I try to select all by clicking on the item with ng-model="selectAll"
, this property remains unchanged.
Can someone offer assistance?
Note: My code includes nested ng-repeats, one for shops and another for products. There is also a shopName filter in place. My goal is to select all items by shop, and although the functionality works as intended, the property value.selected
does not change. Value represents a product, while item represents a shop.