Using Angular's ng-repeat, I have a setup to display admin data.
tr(data-ng-repeat="admin in admins")
td {{$index+1}}
td {{admin.profile.AdminName}}
td(ng-if = "admin.account.status === 1") active
td(ng-if = "admin.account.status === 0") Inactive
After making a REST call in my controllers to change the status value, it only reflects after a page reload. I want to update the message in real-time when transitioning from active to inactive without requiring a reload.
$http.post("/admin/changeAdminStatus/" + $scope.value)
.success(function(){
$scope.admin.account.status = !$scope.admin.account.status;
The above code does not achieve this. What is the best approach to make real-time status changes?