error TS2339: Property 'handleError' does not exist on type 'HeroService' with Angular

It was somewhat "mentioned" in the ToH tutorial, under the "Error Handling" part in the HTTP chapter. But it wasn't really clear that you needed to add this code part to your "hero.service.ts" file (at least if you tend to not fully read through text):

private handleError(error: any): Promise<any> {
    console.error('An error occurred', error); // for demo purposes only
    return Promise.reject(error.message || error);
 }

I just added it to the bottom inside the HeroService class and all worked. Hope it works for you as well :).


Property 'handleError' does not exist on type 'HeroService'

Functions are properties also.

getHeroes(): Promise<Hero[]> {
    return this.http.get(this.heroesUrl)
        .toPromise()
        .then(response => response.json().data as Hero[])
        .catch(this.handleError);  <=== Where is this? Not in HeroService
}

You need to define a handleError method in the HeroService class

handleError(error) {
  // do something with error
}

Looks like you missed this part of the tutorial :-)