I am attempting to run multiple promises simultaneously so that I can perform a task once they have all resolved. Even though there is a rejected promise, '$q.all()' still resolves. Am I missing something in the behavior of '$q.all'?
Appreciate any help on this issue!
function saveOrder () {
return ordersSrv.saveOrder(order).then(function(data) {
console.log('saveOrder OK');
},
function(error) {
console.log('saveOrder KO');
});
}
var aPromises = [saveOrder()];
$q.all(aPromises).then(function () {
console.log('OK');
},
function (error) {
console.log('---> error');
});