The data retrieved from the service request is in JSON format and looks like this:
{
"entries": [{
"id": 2081,
"name": "BM",
"niceName": "bodmas"
}]
}, {
"id": 8029,
"name": "Mas",
"niceName": "Masm"
}]
}],
"count": 2
}
I'm attempting to loop through this data using the following HTML code:
<option ng-repeat="entry in entries" value="{{entry.name}}">{{entry.name}}</option>
However, running the code results in an error message:
Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: entry in entries, Duplicate key: string:c
Here is the snippet of code from my controller:
myApp.controller("MyController", ['$scope', '$http', '$log', function($scope, $http, $log){
...
$http.get('https://myServiceURL').success(function(data){
$scope.entries = data;
});
}]);
I would appreciate any insights on why this error is occurring.