Included is an object array being used in an ng-repeat call
And here is the error
For the love of me I cannot seem to get why angular is treating these as duplicates.
Any help is much appreciated.
Included is an object array being used in an ng-repeat call
And here is the error
For the love of me I cannot seem to get why angular is treating these as duplicates.
Any help is much appreciated.
Angular is telling you it doesn't know how to differentiate the items in your list, so you must tell it which field in your objects make it unique. Click here for more documentation on track by
To do this you need to add track by to your ng-repeat statement. You can specify any field on the object such as yid.
<div ng-repeat="item in items track by item.yid">
...
</div>
However, if you didn't have any fields that tracked uniqueness, you can also track by the index of the item in the list using $index.
<div ng-repeat="item in items track by $index">
...
</div>
track by should be virtually transparent. It should just be a matter of removing the item from the list or reloading the list of items. In the case of your yid that should be unique, so it won't matter in either case.