Hi Angulars,

Why does ngRepeat no longer allow duplicates? I understand that I can get 
them by using *track by $index*, this however seems like a REALLY REALLY 
BAD THING.

This is 100% not intuitive and leads to new developers writing ngRepeat 
without *track by $index* and then having some production site erroring on 
them when duplicates show up. Seems likely that as a result, the default 
way to write an ngRepeat is now *ng-repeat="item in items track by $index"*, 
as this way you will get everything in items and not get weird side effects.

Additionally, why is it ngRepeat's job to worry about duplicates? We have 
filters for a reason! Deduplication should not fall on ngRepeat and instead 
should fall on whoever is passing or owning the array/hash that's being 
looped over.

If this was due to some internal need to track each repeat, why not set the 
default to track by index instead of by value?

Thoughts on this?

P.S: I love angular :)

Cheers,
Wes

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to