title: Angular JS binding scope data within ng-repeat to form
body: <p>I have a collection of items in $scope.data with fields "id","name" &amp; "age", that are being displayed in the view using ng-repeat directive. 
  For each set of items, there is a corresponding "edit button". </p>
  
  <p>I want to be able to access values for the particular set of items for which edit button was pressed.</p>
  
  <p>Html:</p>
  
  <pre><code>&lt;div ng-controller="Ctrl"&gt;
      &lt;div ng-repeat="i in data"&gt;
          Name: {{i.name}}
          Age: {{i.age}}
  
          &lt;form ng-submit="submit()"&gt;
              &lt;input type="text" ng-model="i.id"/&gt;
              &lt;input type="submit" value="Edit" /&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>function Ctrl($scope) 
  {
    $scope.data = [
      {id:1,name:"Alex",age:22},
      {id:2,name:"Sam", age:28}
      ];
  
      $scope.submit = function() {
          //access id of user for which edit was clicked
      };
  }
  </code></pre>
  
  <p>What is the right way to do this?</p>