.controller('CouponsCtrl', ['$scope', '$http', '$window', '$location', '$ionicPopup','$ionicLoading',
function($scope, $http, $window, $location, $ionicPopup,$ionicLoading) {
$scope.find = function() {
$http.get('').success(function(data, dealers, response) {
$scope.coupons = data;
});
}
}
])
<div class="list card" data-ng-repeat="coupon in coupons | filter:couponquery ">
<div class="item item-body" style="padding:10px;">
<img class="full-image" ng-src="{{coupon.Coupon_Image}}">
<p style="color:green;font-weight:700">
{{coupon.Store_Name}}
</p>
<p style="font-weight:700">{{coupon.Offer_Meassage}}</p>
</div>
<div class="item tabs tabs-secondary tabs-icon-left" >
<a class="tab-item" ng-click="apply(coupon._id,coupon.Store_ID)" id="appcolor">
<i class="icon ion-checkmark-circled" ></i>
Activate
</a>
</div>
</div>
i have created 3 discounts.1st one is valid for 10 customers,2nd one is valid for 5 customers and 3rd one is valid for 20 customers.In user profile, I have displayed the promotions with an activate button using ng-repeat. Once a customer activates a discount, its details are stored in a table and the count of available discounts decreases by 1. For example, if a user activates the 1st promotion, the count (10) is reduced to 9 remaining promotions, which is functioning correctly. Expectation: After a customer activates a discount, I want to remove it from the ng-repeat in their profile or change the button status to "Activated" and disable the button in that specific profile.