Angular 6: Property 'catch' does not exist on type 'Observable'?

前端 未结 8 1652
情深已故
情深已故 2020-12-15 18:39

I am upgrading my app to Angular 6. I am upgrading from Angular 4, but the code below is causing errors in Angular 6, where it worked fine

8条回答
  •  無奈伤痛
    2020-12-15 19:30

    First of all install the rxjs packages using below command

    npm i rxjs-compat
    

    then import the libraries using

    import 'rxjs/add/operator/catch';
    

    Or import Observable this way:

    import {Observable} from 'rxjs/Rx';
    

    But in this case, you import all operators.

    got from below link https://code-examples.net/en/q/235b329

提交回复
热议问题