Created
August 23, 2016 13:12
-
-
Save alxvallejo/ee6e182e91a877704ca4c179749eb987 to your computer and use it in GitHub Desktop.
This file contains 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
if (!this.account) { | |
return $http | |
.post('/api/account/get', {}) | |
.then((r) => { | |
this.account = BaseModel.parse(r); | |
return BaseModel.parse(r); | |
}); | |
} | |
else { | |
let deferred = $q.defer(); | |
deferred.resolve(this.account); | |
return deferred.promise; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment