k h*_*ish 54 angular angular-observable rxjs6
import { Observable, of } from "rxjs";
// And if I try to return like this
return Observable.of(this.purposes);
Run Code Online (Sandbox Code Playgroud)
我收到一个错误说明,'''类型'不存在'Observable'属性'
tim*_*545 104
看起来cartant的评论是正确的,RxJS升级指南没有特别涵盖该方法,但确实说"对可观察对象进行操作的类已被函数替换"
这似乎意味着所有或大多数类方法,如.of,.throw等已经被一个函数所取代
而不是
import { Observable, of } from "rxjs";
Observable.of(this.purposes);
Run Code Online (Sandbox Code Playgroud)
做
import { of } from "rxjs";
of(this.purposes);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
38571 次 |
最近记录: |