In my following extract of code of Ionic 3, even after adding all the imports for rxjs operator of map, still the issue persists.
TypeError: this.http.get(...).map is not a function
my imports already added and code are as follows:
import { map } from 'rxjs/operators';
import "rxjs/add/operator/map";
import "rxjs/Rx";
import { Injectable } from "@angular/core";
import { HTTP } from "@ionic-native/http";
import { BehaviorSubject } from "rxjs/BehaviorSubject";
import { Observable } from "rxjs/Observable";
public method(): Observable<any> {
return this.http
.get(this.getMethodUrl)
.map(this.extractResponse)
.catch(this.handleError);
}
RxJs version : 5.2.11
Ionic:
ionic (Ionic CLI) : 4.0.0
(C:\Users\Genesis-PC\AppData\Roaming\npm\node_modules\ionic)
IonicFramework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.11
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.1.1
System:
NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm :6.4.0 OS : Windows 10
Even if this issue has been discussed and resolved on StackOverflow previously, none of them is working for me.
Any help will be profoundly appreciated!
mapno longer exists as a function on theObservable, you must now use lettable operators withpipe