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

This commit is contained in:
Ward Bell 2016-11-29 00:14:52 -08:00 committed by GitHub
parent 79dc1f2dc8
commit 350dadb63e
1 changed files with 4 additions and 4 deletions

View File

@ -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) { }
@ -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));
@ -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
}