我在下面有这段代码,我同时完成和添加,并且当我调用控制器时,我一直使用添加作为停止加载旋转器的方法,因为这似乎是停止加载旋转器的正确方法(如果存在)从控制器获取的调用存在一些问题,因为总是调用 Add()。
但是我想知道complete的用途是什么,以及我是否应该使用它而不是add来阻止我的旋转器在客户端旋转?添加和完成有什么区别?
this.loadingSpinner = true;
this.membersService.getMemberProfile().subscribe({
next: (v) => {
// load profile into form
},
error: (e) => {
console.error(e);
},
complete: () => {
this.loadingSpinner = false;
}
}).add(() => {
this.loadingSpinner = false;
});
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号