Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(toh-6): fix hero.service per issue #2883 #2899

Merged
merged 1 commit into from
Nov 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions public/docs/_examples/toh-6/ts/app/hero.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class HeroService {
private headers = new Headers({'Content-Type': 'application/json'});
// #enddocregion update
// #docregion getHeroes
private heroesUrl = 'app/heroes'; // URL to web api
private heroesUrl = 'api/heroes'; // URL to web api

constructor(private http: Http) { }

Expand All @@ -33,8 +33,8 @@ export class HeroService {
.catch(this.handleError);
// #enddocregion catch
}
// #enddocregion getHeroes

// #enddocregion getHeroes
getHero(id: number): Promise<Hero> {
return this.getHeroes()
.then(heroes => heroes.find(hero => hero.id === id));
Expand Down Expand Up @@ -71,11 +71,11 @@ export class HeroService {
}
// #enddocregion put, update

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