Angular 5 to 6 Upgrade: Property 'map' does not exist on type Observable

前端 未结 4 1907
误落风尘
误落风尘 2020-12-03 10:18

Ive upgraded my angular application from version 5 to 6 and im getting this error from the following code.

  const request = this.evidenceService.get().map((         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-03 10:58

    This solved my problem here is the code:

    import { map } from "rxjs/operators";
    

    **********************************************Example**Below**************************************

    getPosts(){
    this.http.get('http://jsonplaceholder.typicode.com/posts')
    .pipe(map(res => res.json()));
    }
    }
    

提交回复
热议问题