<a class="w3-btn w3-red" ng-model="item.cart"
ng-click="isDisabled || addProductInCart($index,list)"
ng-disabled="isDisabled">Add To Cart
</a>
//Here our controller code:-
/**
* @Summary:addProductInCart , to add prodduct in cart.
* @param: index, items
* @return: NA
* @Description:
*/
$scope.item = {};
$scope.prouctInCartList = [];
$scope.totalAmountDisplay = 0;
$scope.countProducts = 0;
$scope.isDisabled = false;
$scope.addProductInCart = function(index, item) {
$scope.isDisabled = true;
var data = {
index :index,
cart : item
}
$rootScope.prouctInCartList.push(data);}
And than your controller sets that:
addToCart(index, ...rest) {
...
this.isDisabled[index] = true;
...
}
(Or whatever the method names, typing on a phone here).