Type Error: observable.of is not a function - angular-cli@1.6.3 - rxjs@5.5.x - angular5

断了今生、忘了曾经 提交于 2019-12-02 07:28:45

When using lettable (now known as pipeable) operators and factory functions, those are just functions, not methods of Observables. So it should just be

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

const x = of(true, false);
const y = fromEvent(target, 'click');

See how the documentation uses the range factory function.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!