Created
February 2, 2018 18:37
-
-
Save theredpea/ad2b314f6a86f7c6d15b86f8c49c05a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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