I'm trying to use map operator from RxJS but it throws an error saying
Property 'map' does not exist on type 'Observable'.
Here is the code
import { Injectable } from "@angular/core";
import { Http } from "@angular/http";
import "rxjs/add/operator/map";
@Injectable()
export class DataService {
constructor(public http: Http) {}
getData() {
return this.http
.get("https://jsonplaceholder.typicode.com/users")
.map(res => res.json());
}
}