I recently got the console error `
Error: [ngRepeat:dupes] duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys...
which I then used 'track by $index'
and the issue was solved...
But that got me thinking... is there a reason why you wouldn't want to use track by $index
in an ng-repeat?
I've read SO questions like this one as well as other articles, but it seems like almost all of the articles only talk about the advantages of using 'track by'
.
Can someone list the disadvantages and give an example of when you wouldn't want to use track by $index
?