title: How to find index in AngularJS through directive?
body: <p>I have tried to get index like this</p>
  
  <p>this is my html</p>
  
  <pre><code>  &lt;div ng-repeat="item in items" ng-click="findindex($index)"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>this is controller</p>
  
  <pre><code> $sceop.findinedx=function(index)
  {
      alert(index);
  }
  </code></pre>
  
  <p>here i am able to get index value.but i want to get index value through directive </p>
  
  <p>this is my html  </p>
  
  <pre><code> &lt;div ng-repeat="item in items" my-directive&gt;&lt;/div&gt; 
  </code></pre>
  
  <p>this is my directive </p>
  
  <pre><code>   app.directive('myDirective',function()
     {
          return function(scope, elem, attrs,$index) 
          {
                elem.bind('click', function($index)
                {
                     alert($index);
                });
          });
     };
  </code></pre>
  
  <p>here i am not able to get index..so how to get index value in directive?</p>