I am working with the following HTML structure:
<div ng-repeat="image in images">
<img ng-src="img/{{image}}_off.png" />
</div>
Additionally, I have the following JavaScript code in the controller:
$scope.images = ['imga','imgb','imgc'];
In my project directory, I have the following image files:
imga_off
imga_on
imgb_off
imgb_on
imgc_off
imgc_on
The task at hand is to implement functionality that allows switching between the 'on' and 'off' state of an image when it is clicked.
I am considering different approaches. Would it be best to attach an ng-model for each img-element or is there a more efficient way to achieve this?