Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   if (! $scope.loading) $scope.loading = 0;
  2.  $scope.refresh_statistics = function () {
  3.       $scope.loading ++;
  4.       $http.post(HOST + "/rpc/refresh_stats", {
  5.         'statsId': json_stats.id
  6.       }).success(function (data) {
  7.           if (data['status'] == 'OK') {
  8.             console.log("we are in ok");
  9.             growl.addSuccessMessage(JSON.stringify(data))
  10.           }
  11.           else {
  12.             growl.addErrorMessage(JSON.stringify(data))
  13.           }
  14.           $scope.loading--;
  15.         }
  16.       ).error(function(data){growl.addErrorMessage(JSON.stringify(data)); $scope.loading--;});
  17.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement