How do you toggle an active state ng-class in an ng-repeat item using ng-click?
问题 <ul> <li data-ng-repeat="image in images" data-ng-click="toggle = !toggle" data-ng-init="toggle=false"> <img data-ng-class="{'active' : toggle}" src="" /> </li> </ul> CSS for 'active' class is from bootstrap. So toggling works, which is almost where I want it; I would like it similar to active states in navigation links, except in my example it's dealing with images so need to worry about url strings, etc. I tried emulating this example found here to no avail (I tried the same logic for