我该怎么做 join 2+ 有 Angular 的 promise ?
(我已经看到了 chain 他们的文档,但这不是我需要的)
我想在 Q 中实现的示例:
Q.all([promiseA, promiseB]).done(function () {
console.log("Both promises have been executed concurrently and then resolved");
});
最佳答案
使用 $q.all()
$q.all([promise1, promise2]).then(function (result) {
// result should be an array
}, function () {
// call when either promise1 or promise 2 is rejected
});
关于angularjs - 以 Angular 加入 promise ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21287655/