title: unable to get the index of the selected item in AngularJs
body: <p>I have a drop down with values which I am using a drop box to display the items. I want to handle the click event and print the index of the element in the array. The view code is as below: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app="myApp"&gt;
    &lt;head&gt;
      &lt;link data-require="bootstrap-css@3.3.6" data-semver="3.3.6" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css" /&gt;
      &lt;link data-require="font-awesome@4.5.0" data-semver="4.5.0" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.css" /&gt;
      &lt;script data-require="jquery@*" data-semver="2.1.4" src="https://code.jquery.com/jquery-2.1.4.js"&gt;&lt;/script&gt;
      &lt;script data-require="bootstrap@*" data-semver="3.3.6" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;     &lt;/script&gt;
      &lt;script data-require="angular.js@1.4.7" data-semver="1.4.7" src="https://code.angularjs.org/1.4.7/angular.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="style.css" /&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body ng-controller="myController"&gt;
      &lt;select ng-options="item for item in items" ng-model="item" ng-change="handleClick($index)"&gt;
    &lt;/select&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>On the controller I have the function but I am not getting the index on selecting.</p>
  
  <pre><code>// Code goes here
  
  angular.module("myApp", []).
  
  controller("myController", function($scope){
       $scope.handleClick = function(index){
       console.log("came inside the handleClick function with the currext index "+index);
      }
      $scope.items=["pradeep","praveen", "sagar","vinod"];
  })
  </code></pre>
  
  <p>Please let me know where I am going wrong. link to Plunkr - <a href="http://plnkr.co/edit/Qy4DyJpXKIOKgcMHDzLy?p=preview" rel="nofollow">Link to Plnkr</a></p>