Property 'map' does not exist on type 'Observable<Object>'
Bonsoir,
J'ai une erreur à la compile il me dit " Module not found : error: Can't resolve 'rxjs/add/operator/map' in '/home/cdevl/angular-crypto/src/app' " alors que j'ai bien tout déclarer.
Pouvez vous m'aider car je ne vois vraiment pas ou j'aurais fais une erreur ?
Mon source :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| import { Injectable } from '@angular/core';
//import { Http } from 'angular/Http';
import { HttpClient } from '@angular/common/http';
//import 'rxjs/add/operator/map';
import 'rxjs/add/operator/map';
@Injectable()
export class DataService {
result:any;
constructor(private _http: HttpClient) {}
getPrices() {
return this._http.get("https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,IOT&tsyms=USD")
.map(result => this.result = result);
}
} |