title: how to get array item from ng-repeat?
body: <p>I am  trying to get the item of array on click when I am working with the reverse array. but getting the wrong index values.</p>
  
  <p>when I clicked on `[7] Sebastian who is 50 years old </p>
  
  <pre><code>&lt;button ng-click="show_id($index)"&gt;get my id&lt;/button&gt;
  </code></pre>
  
  <p>I want alert value should be 7 not 0 but it alerts 0</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Example&lt;/title&gt;
  
  
  
    &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.1/angular.min.js"&gt;&lt;/script&gt;
  
  
  &lt;script&gt;
  angular.module("my_app",[])
  .controller("my_ctr",function($scope){
  
      $scope.show_id=function(index){
          alert(index);
      }
  })
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body ng-app="my_app" ng-controller="my_ctr"&gt;
      &lt;div ng-init="friends = [
      {id:1, name:'John', age:25, gender:'boy'},
      {id:2, name:'Jessie', age:30, gender:'girl'},
      {id:3, name:'Johanna', age:28, gender:'girl'},
      {id:4, name:'Joy', age:15, gender:'girl'},
      {id:5, name:'Mary', age:28, gender:'girl'},
      {id:6, name:'Peter', age:95, gender:'boy'},
      {id:7, name:'Sebastian', age:50, gender:'boy'},
  
    ]"&gt;
      I have {{friends.length}} friends. They are:
  
      &lt;ul&gt;
        &lt;li  ng-repeat="friend in friends.slice().reverse() "&gt;
          [{{friend.id}}] {{friend.name}} who is {{friend.age}} years old.
          &lt;button ng-click="show_id($index)"&gt;get my id&lt;/button&gt;
  
        &lt;/li&gt;
  
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to do edit and update that particular record how can I do that?</p>