RXJS 'map' Operator Change in angulr

PHOTO EMBED

Fri Dec 18 2020 22:23:35 GMT+0000 (Coordinated Universal Time)

Saved by @dedicatedking #nodejs,angular

16

In rxjs 6 map operator usage has been changed now you need to Use it like this.

import { map } from 'rxjs/operators';
myObservable
  .pipe(map(data => data * 2))
  .subscribe(...)
             
For the Angular 7v

Change

import 'rxjs/add/operator/map';
 Save
To

import { map } from "rxjs/operators"; 
 Save
And

 return this.http.get('http://localhost/ionicapis/public/api/products')
 .pipe(map(res => res.json()));
content_copyCOPY

https://stackoverflow.com/questions/37208801/property-map-does-not-exist-on-type-observableresponse