title: update multiple rows with one update button in angularjs
body: <p>I have 3 data. What I want now is to update them all using a one button but I don't know how to start or how can I get the id of each data. When the data is updated it should alert the updated value. </p>
  
  <p>Any suggestions for this? Thanks</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>angular.module('myApp', [])
      .controller('bookCtrl', function ($scope) {
      $scope.book = {
          name: 'Session Invites',
          friends: [{
              'id': 1,
                  'name': 'raju'
          }, {
              'id': 2,
                  'name': 'radha'
          }, {
              'id': 3,
                  'name': 'luttappi'
          }]
      };
      $scope.update = function (friend) {
  
          alert(friend.name);
      };
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app="myApp"&gt;
    &lt;div ng-controller="bookCtrl"&gt;
      &lt;div ng-repeat="friend in book.friends"&gt;
        &lt;input type="text" ng-model="friend.name" /&gt;
        
      &lt;/div&gt;
       &lt;input type="button" id="btn" name="btn" value="update" ng-click="update(friend)" /&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>