【发布时间】:2020-07-13 15:50:31
【问题描述】:
我有一个 Angular 应用程序 (9) 并且有多个组件请求计算操作而不是休息,并在不同的编辑器中显示结果。 现在,在我发出请求之前,我调用了一个加载面板,在请求完成后,我在 finalize 回调中隐藏了加载面板。像这样的:
this.isloading = false;
httpclient.get('http://localhost/calculate').pipe(finalize(() =>this.isloading=false).subscribe(v=>{
//make some operations with the data and set editor values
});
现在加载面板在设置所有编辑器值之前消失。如果请求完成直接调用finalize回调,但是如果subscribe或者error里面的代码完成了怎么调用finalize之类的呢?
【问题讨论】:
标签: angular observable rxjs6 rxjs-pipeable-operators rxjs-observables