Created
January 7, 2016 03:32
-
-
Save ronsuez/7308cfcc9af8ebce93ff to your computer and use it in GitHub Desktop.
angular-gists
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
//http function promise example | |
function getPackages(){ | |
var deferred = $q.defer(); | |
$http.get(BaseApiUrl + '/packages/') | |
.success(function(data, status, headers, config) { | |
deferred.resolve(data.results); | |
}) | |
.error(function(status) { | |
deferred.reject(status); | |
}); | |
return deferred.promise; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment