title: Using $index for ng-model
body: <p>I am building a SPA where one can add a table-row on button-click:</p>
  
  <pre><code>&lt;!-- Table --&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Lieferscheinnummer&lt;/th&gt;
      &lt;th&gt;Stück&lt;/th&gt;
    &lt;/tr&gt;
  
    &lt;tr ng-repeat="position in positions"&gt;
      &lt;td&gt;&lt;input type="text"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;!-- button --&gt;
  &lt;span ng-click="addPosition()"&gt;&lt;/span&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$scope.positions = ['1'];
  $scope.addPosition = function(){
      $scope.positions.push( $scope.positions.length + 1 );
  }
  </code></pre>
  
  <p>Now I have to apply an unique <code>ng-model</code> to each <code>&lt;td&gt;</code> of every row in order to send the given input to my database.</p>
  
  <p>I searched for a solution and stumbled over <code>ng-repeat</code>'s <code>$index</code>.
  Unfortunately, <code>$index</code> seems to be not available for element attributes:</p>
  
  <pre><code>&lt;tr ng-repeat="position in positions"&gt;
      &lt;td&gt;&lt;input type="text" ng-model="{{$index +1}}"&gt;&lt;/td&gt; &lt;!-- does not work --&gt;
      &lt;td&gt;&lt;input type="text"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>How would I apply an unique <code>ng-model</code> to each row while using <code>ng-repeat</code>?</p>