I've been facing an issue with checklist-model while working with an array of check-boxes. The problem arises when I try to delete selected items within an ng-repeat loop. Everything works fine initially, but when I add track by $index
along with ng-repeat
, the deleted check-boxes still seem to linger around. Removing the track by
solves the issue, but it is necessary for my real app. Here's a link to the plnkr demonstrating the problem: Demo
To reproduce the problem, follow these steps:
- Select any check-box you want
- Delete the selected items
- Check the "check all" button to observe
With the track by
in place, some check-boxes remain unchecked. Manually rechecking them results in the old values being added back to the list. This behavior is quite odd. Any help or explanation would be highly appreciated. Thank you.