【发布时间】:2021-10-25 09:23:32
【问题描述】:
如果我的第一个 Observable 抛出错误,那么我就不会订阅我的 switchMap observable。
这可能吗?
this._profileService.updateProfile(profile).pipe(
tap(profile => {
this.profile = profile;
this.saving = false;
this.updateForm(this.profile);
}),
catchError(error => {
console.log(error);
this.saving = false;
this.updateForm();
return this._pjNotificationService.show(PjNotificationType.ERROR, 'Fehler beim Speichern',
`Beim Speichern ist ein Fehler aufgetreten. ${error}`, 15000)
}),
switchMap(() => this._pjNotificationService.show(PjNotificationType.SAVED, 'Änderungen gespeichert', '', 15000))
).subscribe();
【问题讨论】:
标签: javascript angular typescript rxjs observable