Say I have
<div ng-repeat="i in items">
<span ng-show="editing">i.something</span>
<span ng-show="!editing">i.something</span>
<a ng-click="dosomething(i)">click</a>
</div>
in the controller I have:
$scope.dosomething = function (model){
//do stuff
editing = false;
}
How can I access the variable of only the iteration of the ng-repeat, i've tried passing editing through as a parameter to dosomething i've tried accessing it through $scope.editing, I've been looking through $rootScope documentation. Can't work it out.
I acknowledge I could add editing as a parameter of i but I'd rather not touch the model unnecessarily if there is a way to access each scope respectively without changing editing for the other iterations.