Related questions
Error handling in AngularJS http get then construct
How can I handle an HTTP error, e.g. 500, when using the AngularJS "http get then" construct (promises)?
$http.get(url).then(
function(response) {
console.log('get',response)
}
)
Problem is, for any non 200 HTTP response, the inner function is not …
How to access the value of a promise?
I'm looking at this example from Angular's docs for $q but I think this probably applies to promises in general. The example below is copied verbatim from their docs with their comment included:
promiseB = promiseA.then(function(result) {
return result + 1;
});
// …
How to return a resolved promise from an AngularJS Service using $q?
My service is:
myApp.service('userService', [
'$http', '$q', '$rootScope', '$location', function($http, $q, $rootScope, $location) {
var deferred;
deferred = $q.defer();
this.initialized = deferred.promise;
this.user = {
access: false
};
this.isAuthenticated = function() {
this.user = {
first_name: 'First',
…