-
Notifications
You must be signed in to change notification settings - Fork 27.6k
ng-repeat track by $index side effect (BUG) #7119
Comments
Your problem is simply that the |
Yes it can be solved using
|
There is no reason that |
I think I understand now that From the documentation ( http://docs.angularjs.org/api/ng/directive/ngRepeat ):
plunkr: http://plnkr.co/edit/t16PNyBIzaDVSA4WLDcj?p=preview |
|
Ok, should I open an issue on angular.org? (closing this one) |
hi , have problem with updating element i |
Thanks!!!! |
When using
ng-repeat
withtrack by $index
option I can not delete correct element from array or object (ng-repeat
will always remove the last element).plunkr: http://plnkr.co/edit/mnw4DL7D8wn1hP7ThSD4?p=preview
(the plunkr is a bit complicated, because I did not know what was causing this issue at first, clicking on green or blue square should remove it but it removes the last square - the yellow one instead!)
Using
track by $id(item)
works correctly.The text was updated successfully, but these errors were encountered: