Skip to content

Instantly share code, notes, and snippets.

@theredpea
Created February 2, 2018 18:37
Show Gist options
  • Select an option

  • Save theredpea/ad2b314f6a86f7c6d15b86f8c49c05a9 to your computer and use it in GitHub Desktop.

Select an option

Save theredpea/ad2b314f6a86f7c6d15b86f8c49c05a9 to your computer and use it in GitHub Desktop.
var user_promise;
var user_result;
//inject the '$http' service by wrapping this in angular controller, or using a substitue for http
var refresh_user = function () {
//Only need to get this information once
user_promise = $http({
method: 'GET',
url: urlService.path('/qps/user')
});
var refresh_user_result = user_promise
.then(function (user_result) {
user_result = user_result;
return user_result;
});
return refresh_user_result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment