Abdul Moiz Abdul Moiz - 1 year ago 77
AngularJS Question

ng-repeat duplicate issue, when there are not any duplicates

$scope.subjects = [
"Computer Security", "Graphics and Multimedia",
"Networks", "Computer Science and Engineering", "Game Design",
"Programming", "Information Technology", "Software Engineering",
"Technology Management", "Telecommunications", "Web Development",
"Environmental Sciences", "Biology", "General", "Aviation",
"Mathematics", "Engineering"];

<label class="concentration-label3" ng-repeat="subject in subjects">
<input type="checkbox" name="concentrations" class="concentration-label3__input js-concentration-value" value="" data-mixpanel-subject="Design">
<span class="concentration-label3__title" for="conc1">
<span class="concentration-label3__title__checkmark4"></span>

Issue: Error: ngRepeat:dupes Duplicate Key in Repeater

Answer Source

Try to add a track in your ng-repeat:

<label class="concentration-label3" ng-repeat="subject in subjects track by $index">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download