On button click I wan't to disable all buttons to prevent any other operation.
For this I use request.isProcessing
bool value.
In the beginning function approve(request)
I set request.isProcessing
to true
and In the end to false
.
But this doesn't work. (For request in ng-repeat request.isProcessing
doesn't change)
Is it because I am in different scope
or what?
<div class="one-third" ng-repeat="request in pendingRequests track by request.id">
...
<div class="button-container">
<button ng-click="approve(request);" ng-disabled="request.isProcessing" class="btn btn-primary">Confirm<i ng-hide="request.isProcessing" class="fa fa-check"></i><span ng-show="request.isProcessing" class="spinner no-hover"><a><i class="fa-li fa fa-spinner fa-spin"></i></a></span></button>
<button ng-click="reject(request);" ng-disabled="request.isProcessing" class="btn btn-default pull-right" am-hide-request-resolve-div>Reject <i ng-hide="request.isProcessing" class="fa fa-times"></i><span ng-show="request.isProcessing" class="spinner no-hover"><a><i class="fa-li fa fa-spinner fa-spin"></i></a></span></button>
</div>
</div>
$scope.approve = function (request) {
request.isLoading = true;
//functionality of approving
request.isLoading = false;
}