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

ng-repeat fails for object iterations with identical values

Open godmar opened this issue 14 years ago • 3 comments

Noted by Joshua Heiland on the angularjs mailing list. His test case: http://jsfiddle.net/87fjX/ A shorter test case http://jsfiddle.net/68CYt/1/

Problem still persists in HEAD of master branch. From a brief examination, looks like a logic bug in the ng-repeat directive here: https://github.com/angular/angular.js/blob/master/src/ng/directive/ngRepeat.js#L117-135

Notably, you can't assume that you've already seen an element just because the value is the same.

godmar avatar Sep 19 '12 13:09 godmar

It is slightly better with 1.0.3 but not yet there: http://jsfiddle.net/68CYt/3/

pkozlowski-opensource avatar Nov 27 '12 09:11 pkozlowski-opensource

This issue is not in 1.0.7, or 1.1.1, but is present in 1.1.5. When using (key, value), ng-repeat cannot handle identical "value"s.

http://jsfiddle.net/ktDUW/19/

dkingsbury avatar Jul 31 '13 13:07 dkingsbury

track by solved this issue. if there are still some cases left uncovered please open a new issue and send us a plunker

IgorMinar avatar Jan 05 '14 07:01 IgorMinar