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

前端 未结 8 1686
情深已故
情深已故 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:37

    Import the Library with following method and rearrange the code

    import { catchError } from 'rxjs/operators';
    return Observable.pipe(catchError =>...);
    

    This worked for me.

提交回复
热议问题