title: AngularJS 1.6.6 ng-repeat
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"&gt;&lt;/script&gt;
      &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body ng-app="myApp" ng-controller="mc1"&gt;
  
  
      &lt;label class="control-label"&gt;Semester:&lt;/label&gt;
      &lt;select ng-model="selectedSemesters" ng-change="selectedSemesterChanged()" class="form-control"&gt;
          &lt;option value="{{v.SemesterId}}" ng-repeat="v in semesters"&gt;{{v.SemesterId}}&lt;/option&gt;
      &lt;/select&gt;
      &lt;script&gt;
          var app=angular.module('myApp',[]);
          app.controller('mc1',function($scope)
          {
              $scope.semesters='[{"SemesterId":"Fall 2017"},{"SemesterId":"Spring 2017"}]';
          })
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I run this page, I get the error error: [ngRepeat:dupes]. I tried to add track by $index but it totally doesn't work. </p>
  
  <p>Can anyone tell me the reason?</p>
  
  <p>Edit: Sorry I didn't explain clear. I use library in C# to convert a datatable object to json string. Then pass this to the web page through web api. In the script, I use angular.jsonFrom(response.data).</p>
  
  <p>And response in browser is "[{\"SemesterId\":\"Fall 2017\"},{\"SemesterId\":\"Spring 2017\"}]". I have fixed the bug but I don't know why.</p>
  
  <p>Thanks all. PS. Correct answer is followed.</p>
  
  <pre><code>&lt;body ng-app="mySelect" ng-controller="myCt"&gt;
      &lt;select ng-model="mySelected1"&gt;
          &lt;option ng-repeat="x in data1"&gt;{{x.SemesterId}}&lt;/option&gt;
      &lt;/select&gt;    
  
      &lt;select ng-model="mySelected2" ng-options="x.SemesterId for x in data1"&gt;{{x.SemesterId}}&lt;/select&gt;
  
      &lt;label ng-model="data1"&gt;&lt;/label&gt;
      &lt;script&gt;
          var app = angular.module('mySelect', []);
          app.controller('myCt', ['$scope', function ($scope) {
  
               $scope.data1=angular.fromJson('[{\"SemesterId\":\"Fall 2017\"},{\"SemesterId\":\"Spring 2017\"}]');
          }]);
  
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>