title: using ng-model within nested ng-repeat directives
body: <p>I'm trying to use ng-model "within" a ng-repeat directive that is itself nested in a ng-repeat directive.</p>
  
  <p>The following jsfiddle demonstrates my problem and my two attempts to solve it.</p>
  
  <p><a href="http://jsfiddle.net/rskLy/4/">http://jsfiddle.net/rskLy/4/</a></p>
  
  <p>My Controller is defined as follows:
  </p>
  
  <pre><code>var mod = angular.module('TestApp', []);
  mod.controller('TestCtrl', function ($scope) {        
  var machine = {};
  machine.noteMatrix = [
      [false, false, false],
      [false, true, false],
      [false, false, false]
  ];
  
  $scope.machine = machine;
  
  // ...
  });
  </code></pre>
  
  <p><strong>1.</strong>
  </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;--&lt;/th&gt;
              &lt;th ng-repeat="no in machine.noteMatrix[0]"&gt;{{$index+1}}&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr ng-repeat="track in machine.noteMatrix"&gt;
              &lt;td&gt;--&lt;/td&gt;                
              &lt;td ng-repeat="step in track"&gt;                    
                  &lt;input type="checkbox" ng-model="track[$index]"&gt; {{step}}
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The first example/attempt updates the machine.noteMatrix inside the controller, but everytime a checkbox is pressed, angularjs displays the following error twice  in the javascript console:</p>
  
  <blockquote>
    <p>Duplicates in a repeater are not allowed. Repeater: step in track</p>
  </blockquote>
  
  <p>and sometimes it will also display this error:</p>
  
  <blockquote>
    <p>Duplicates in a repeater are not allowed. Repeater: no in machine.noteMatrix[0]</p>
  </blockquote>
  
  <p><strong>2.</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;--&lt;/th&gt;
              &lt;th ng-repeat="no in machine.noteMatrix[0]"&gt;{{$index+1}}&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr ng-repeat="track in machine.noteMatrix"&gt;
              &lt;td&gt;--&lt;/td&gt;                
              &lt;td ng-repeat="step in track"&gt;                    
                  &lt;input type="checkbox" ng-model="step"&gt; {{step}}
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The second example/attempt reads the data correctly from the noteMatrix and no errors are displayed in the javascript console when checking/unchecking the checkboxes.  However changing their states is not updating the machine.noteMatrix in the controller (press the "Show Matrix" button to see the matrix in the jsfiddle).</p>
  
  <p>Can anyone shed a light on this? :)</p>