Could not use Observable.of in RxJs 6 and Angular 6

后端 未结 3 711
春和景丽
春和景丽 2020-12-08 09:23
 import { Observable, of } from \"rxjs\";

// And if I try to return like this
  return Observable.of(this.purposes);

I am getting an error stating

3条回答
  •  一整个雨季
    2020-12-08 10:11

    To avoid black-list linting of the rxjs, import them like this:

    import { Observable } from 'rxjs/Observable';
    import { of } from 'rxjs/observable/of';
    

提交回复
热议问题