AngularJS: Error: Duplicates in a repeater are not allowed

Using AngularJS I was getting the error “Error: Duplicates in a repeater are not allowed.” I found a comment on StackOverflow that suggested instead of:

<div ng-repeat="row in [1,1,1]">

To use:

<div ng-repeat="row in [1,1,1] track by $index">

A magical ‘track by $index’!

Leave a Reply