Is it possible that I cancel a promise without going to it's error scenario ?
var a = b.getPromise().
success(function(){
//whoa
})
.error(function(){
//no!!!
})
b = {};
b.getPromise = function(){
return $q.defer().promise;
}
Is it possible that I cancel a promise without going to it's error scenario ?
var a = b.getPromise().
success(function(){
//whoa
})
.error(function(){
//no!!!
})
b = {};
b.getPromise = function(){
return $q.defer().promise;
}
I don't think you can cancel Angular $q
promises at all?
But if you don't want to call either handlers, you will have to return a promise that is forever pending. Not that I would recommend that…
A better idea would be to cancel so that the error path is activated, and you handle the cancellation case there explicitly.