当我运行linter时,它会报告:
subscribe is deprecated: Use an observer instead of an error callback
这个 Angular 应用程序的代码来自此处:
this.userService.updateUser(data).pipe(
tap(() => {bla bla bla})
).subscribe(
this.handleUpdateResponse.bind(this),
this.handleError.bind(this)
);
不知道应该使用什么和如何使用...。谢谢!
.subscribe({ next: this.handleUpdateResponse.bind(this), error: this.handleError.bind(this) })
。 - kos