title: how to bind $index from ng-repeat to controller
body: <p>In Angular I wanted to bind $index to controller. How can I send $index value in to my controller. Here is my html code.</p>
  
  <pre><code>&lt;body&gt;
  &lt;div class="container"&gt;
      &lt;div class="row row-content" ng-controller="demoController as demoCtrl"&gt;
      &lt;ul&gt;
      &lt;li ng-repeat="val in demoCtrl.list" &gt;Hello {{$index}}&lt;/li&gt;
      &lt;/ul&gt;       
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is my controller code</p>
  
  <pre><code>var app = angular.module('confusionApp',[])
  app.controller('demoController', function(){
      var list = [1,2,3,4,5];
      this.list = list;
  
      var array = ['abc','def','ghi','jkl','mno']
      this.array = array
      console.log(this.array[index]);
  });
  </code></pre>
  
  <p>I need to use ng-modal in HTML and bind that value to some variable in my controller.</p>
  
  <p>Based on the selection of index, it should check in array and respective array should have to print.
  Can any of you please help</p>