title: AngularJS - "Duplicates in a repeater not allowed"
body: <p>I am trying to create a HTML <code>textarea</code> for each member of an array but it is not rendering. I have read the AngularJS docs and have tried various <code>track by</code> expressions to no avail. </p>
  
  <p>The error condition arises if the user enters the same text in multiple <code>textareas</code>. It seems that Angular is using the value of the text area as a unique key. I could hack this by adding and removing an arbitrary identifier prior to the text, but this seems lame. </p>
  
  <p>To be clear the textareas display the problem is after the user clicks submit (javascript only - no round trip to server) and then subsequent code renders what the user typed in.</p>
  
  <p>Thanks-in-advance.</p>
  
  <p><strong>The specific error I get is:</strong></p>
  
  <pre><code>Duplicates in a repeater are not allowed. 
  Use 'track by' expression to specify unique keys. 
  Repeater: openEndedQuestion in openEndedQuestions track by openEndedQuestion.id, 
  Duplicate key: undefined
  </code></pre>
  
  <p><strong>The HTML is:</strong></p>
  
  <pre><code>&lt;tr ng-repeat="openEndedQuestion in openEndedQuestions"&gt;
      &lt;td width="375" style="font-size: 18px;"&gt;
          &lt;b&gt;{{openEndedQuestion}}&lt;/b&gt;&lt;br&gt;
          &lt;textarea id="openEndedAnswer_{{$index}}" cols="80"&gt;&lt;/textarea&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p><strong>The second stage HTML is:</strong></p>
  
  <pre><code>&lt;tr ng-repeat="openEndedAnswer in openEndedAnswers"&gt;
      &lt;td width="375" style="font-size: 18px;"&gt;
          &lt;b&gt;{{openEndedAnswer}}&lt;/b&gt;
      &lt;/td&gt;
  
      &lt;td width="225"&gt;
          &lt;span style="font-size: 35px; padding: 2px; color: #468847;" 
                ng-repeat="starIndex in [0, 1, 2, 3, 4]"
                ng-click="povStarTracker.setStarRating($parent.$index, starIndex + 1)" 
                ng-class="povStarTracker.getClassForStar($parent.$index, starIndex)"&gt;&lt;/span&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p><strong>The underlying JSON is:</strong></p>
  
  <pre><code>"openEndedQuestions" : [ 
      "Do you think the coach is being fair?", 
      "Should the coach give all of his players a chance to play in the games?", 
      "Should Austin say anything about this to his coach?", 
      "What could Ryan say to Austin?"
  ]
  </code></pre>