title: Update table row data in Angular
body: <p>Hello I am learning angular, i need help over a functionality, i have a dynamic table and a form, when i click on a any row of the dynamic table that data should populate in the input boxes of form and when i edit and save the data in input boxes that should reflect with changes on the same. `</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> $scope.Save= function($index){
        
         var user1= angular.copy($scope.displayData[$index]);
         fc.saveData.push(user1);
         console.log(fc.saveData.name);
      }}</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code> 
  &lt;head&gt;
      &lt;script src="https://code.angularjs.org/1.4.9/angular.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;table class="table2"&gt;
      &lt;tr&gt;
          &lt;th&gt;Player&lt;/th&gt;
          &lt;th&gt;Age&lt;/th&gt;
          &lt;th&gt;Ranking&lt;/th&gt;
  
      &lt;/tr&gt;
      &lt;tr ng-repeat=" usr in saveData" ng-click="fnClick(usr)"&gt;
          &lt;td&gt;{{$index}}&lt;/td&gt;
          &lt;td&gt;{{::usr.player}}&lt;/td&gt;
          &lt;td&gt;{{::usr.age}}&lt;/td&gt;
          &lt;td ng-bind="::usr.ranking"&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;` and my input boxes code is here `
  &lt;div&gt;
      &lt;button class="btn" ng-click="Savedata()"&gt;Saveintable&lt;/button&gt;
      &lt;label for="field1"&gt;
       &lt;span&gt;Name&lt;/span&gt;&lt;input type="text" name="" required="true" ng-model="displayData.name"/&gt;
       &lt;/label&gt;
      &lt;label for="field2"&gt;
       &lt;span&gt;Age&lt;/span&gt;&lt;input type="text"  required="true" ng-model="displayData.age"/&gt;
       &lt;/label&gt;
      &lt;label&gt;
       &lt;span&gt;Ranking&lt;/span&gt;&lt;input type="text" ame="" required="true" ng-model="displayData.ranking"/&gt;
       &lt;/label&gt;
  
      &lt;/label&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>