title: Change image src based on ng-click index AngularJS
body: <p>I have this angularJS code, the directive template defines: </p>
  
  <pre><code>&lt;li ng-repeat="i in getNum(myNum)" ng-click="toggle($index)" id=$index&gt;
        &lt;img src="img/{{ImgTest}}"&gt;
   &lt;/li&gt;
  </code></pre>
  
  <p>Also, my directive code has :</p>
  
  <pre><code>link: function (scope, elem, attrs) {            
          scope.ImgTest= "Img_1";
  </code></pre>
  
  <p>On an ng-click I wish to change the image on all the <code>&lt;li&gt;</code> elements before the one clicked from Img_1 to Img_2.  (So change all the <code>&lt;li&gt;</code> elements with an index between 0 and the <code>$index</code> of the one clicked).</p>
  
  <p>How can this be achieved ? <br>.. Thanks</p>