【发布时间】:2019-08-23 14:57:20
【问题描述】:
当我运行 linter 时,它会说:
subscribe is deprecated: Use an observer instead of an error callback
代码(来自带有 angular-cli 的 Angular 7 应用程序):
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) }) -
我无法使用我的 apiRest 使其工作
-
可以在这里找到详细的答案jeffryhouser.com/index.cfm/2019/8/27/…
标签: callback rxjs deprecated tslint subscribe