I have this angularJS code, the directive template defines:
<li ng-repeat="i in getNum(myNum)" ng-click="toggle($index)" id=$index>
<img src="img/{{ImgTest}}">
</li>
Also, my directive code has :
link: function (scope, elem, attrs) {
scope.ImgTest= "Img_1";
On an ng-click I wish to change the image on all the <li> elements before the one clicked from Img_1 to Img_2. (So change all the <li> elements with an index between 0 and the $index of the one clicked).
How can this be achieved ?
.. Thanks
<li>will get the same image- Img_1. Do you want them all to change on the ng-click? Or do you want just the image in that one<li>to change? Or?