You shouldn’t inject Headers into your constructor, and you need to pass RequestOptions to http.get. Example straight from the HTTP Client docs:
addHero (name: string): Observable<Hero> {
let body = JSON.stringify({ name });
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
return this.http.post(this.heroesUrl, body, options)
.map(this.extractData)
.catch(this.handleError);
}
Thanks for the help …I think I’m almost there, but still getting some errors
Return type of public method from exported class has or is using name 'Observable' from external module "C:/ionic2/technotip/node_modules/rxjs/Observable" but cannot be named.