title: AngularJS: ng-repeat with associative array
body: <p>I'm trying to implement a simple ng-repeat with associative array but with no success so far. I have the following data:</p>
  
  <pre><code>[1: "Test", 2: "Second Test", 7: "Another Test"]
  </code></pre>
  
  <p>I have this saved in a variable called <code>participantsList</code> which gets send to the HTML. I'm using <code>$parent</code> because I have a wrapping HTML page and the one that contains the <code>ng-repeat</code> is rendered within it. Here's the HTML code:</p>
  
  <pre><code>&lt;select class="form-control" id="participant_drop_down_list" ng-model="$parent.participant_id" required&gt;
     &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="{{key}}"&gt;{{value}}&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>If I don't have the <code>track by key</code> added to the declaration I get the duplicate key error which is odd. With that added, however, I get no errors but the following HTML is actually rendered:</p>
  
  <pre><code>&lt;select class="form-control ng-pristine ng-invalid ng-invalid-required ng-touched" id="participant_drop_down_list" ng-model="$parent.participant_id" required=""&gt;
      &lt;option value="? undefined:undefined ?"&gt;&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="0" class="ng-binding ng-scope"&gt;&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="1" class="ng-binding ng-scope"&gt;Test&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="2" class="ng-binding ng-scope"&gt;Second Test&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="3" class="ng-binding ng-scope"&gt;&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="4" class="ng-binding ng-scope"&gt;&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="5" class="ng-binding ng-scope"&gt;&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="6" class="ng-binding ng-scope"&gt;&lt;/option&gt;
      &lt;option ng-repeat="(key, value) in $parent.participantsList track by key" value="7" class="ng-binding ng-scope"&gt;RT&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Obviously, I don't want the empty options there, I'm interested only in the three that I have initially but I have no idea where things are going south right now. Am I tracking by the wrong value or is the data not formed correctly? Any tips will be welcomed, thank you!</p>
  
  <p>P.S. Is there a way to get rid off the first option with the undefined value as well?</p>