现在在 .then
部分我所有另一个 promise http 请求:
.then(result => { this.service().then(data => {}); });
这是使用链式 promise 的正确方法吗?
最佳答案
差不多了!您需要在函数中返回 promise ,或者像这样:
.then(result => { return this.service().then(data => {}); });
或者像这样:
.then(result => this.service().then(data => {}));
关于angular - 如何使用链式调用 Promise?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45926739/