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

后端 未结 1 1896
无人及你
无人及你 2021-01-24 23:54

After upgrading to angular-cli@1.6.3 and converting all the RxJS imports, methods, and operators to the new >5.5 form, I get a type error at run-time saying that Observabl

相关标签:
1条回答
  • 2021-01-25 00:36

    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.

    0 讨论(0)
提交回复
热议问题