【发布时间】:2017-07-20 08:36:20
【问题描述】:
我在 angular 2 组件中执行 2 个 http 调用。我想在这两个服务调用完成后显示成功消息。我该怎么做?
this._cashierService.postCharge(this.postCharge).subscribe( resPostCharge => {
this.footerNotification.success('Save', 'Successfully saved'); //i want to show this after 2 calls finished
}, errorMessage => {
});
this._cashierService.splitCharge(this.postCharge).subscribe( resPostCharge => {
this.footerNotification.success('Save', 'Successfully saved');
}, errorMessage => {
});
【问题讨论】:
-
使用 fork-join 框架来做到这一点。
标签: javascript angular observable