angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

ng-repeat $middle and $last incorrect when object contains $$hashKey

Open jussik opened this issue 13 years ago • 1 comments

If you use ng-repeat on an object with a $$hashKey, like inside another ng-repeat, the $$hashKey is included in the object size even though it's not displayed in the DOM. This causes $middle and $last to be calculated like there is one more repetition, so the last element is still $middle and $last is never true.

jsFiddle: http://jsfiddle.net/PhkNK/ Plunker: http://plnkr.co/edit/eaFPleVozysvskk1QlhT

Should be (first, middle, last) like in the first block, not (first, middle, middle) like the last two.

jussik avatar Jan 11 '13 11:01 jussik

Confirmed that this also fails on current unstable: v1.1.1. http://plnkr.co/edit/rUR5uC52iJ7zS3P8AwOQ?p=preview

petebacondarwin avatar Jan 11 '13 12:01 petebacondarwin