【发布时间】:2022-10-06 21:58:42
【问题描述】:
在我的页面被渲染之前,我想从 5 个独立的不同 API 中获取数据(不需要等待第一个来从第二个获取数据),一旦它们都完成,我想要一个布尔变量要设置。像这样的东西
http.get(url1).subscribe(response => {
// set response data
// & somehow notify that this call is complete?
});
http.get(url2).subscribe(response => {
// set response data
// & somehow notify that this call is complete?
});
...
如何使用 Angular 和 RxJS 实现这一点?