等待所有诺言解决

等待所有诺言解决,第1张

等待所有诺言解决

当所有链条都解决后,我希望所有人解决。

当然,然后将每个链的承诺传递给

all()
而不是最初的承诺:

$q.all([one.promise, two.promise, three.promise]).then(function() {    console.log("ALL INITIAL PROMISES RESOLVED");});var onechain   = one.promise.then(success).then(success),    twochain   = two.promise.then(success),    threechain = three.promise.then(success).then(success).then(success);$q.all([onechain, twochain, threechain]).then(function() {    console.log("ALL PROMISES RESOLVED");});


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5662445.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存