diff --git a/aio/content/examples/toh-pt5/src/app/hero.service.ts b/aio/content/examples/toh-pt5/src/app/hero.service.ts index c0dc5e85f7..0d7845681b 100644 --- a/aio/content/examples/toh-pt5/src/app/hero.service.ts +++ b/aio/content/examples/toh-pt5/src/app/hero.service.ts @@ -12,16 +12,16 @@ export class HeroService { constructor(private messageService: MessageService) { } getHeroes(): Observable { - // TODO: send the message _after_ fetching the heroes + const heroes = of(HEROES); this.messageService.add('HeroService: fetched heroes'); - return of(HEROES); + return heroes; } // #docregion getHero getHero(id: number): Observable { - // TODO: send the message _after_ fetching the hero + const hero = HEROES.find(h => h.id === id); this.messageService.add(`HeroService: fetched hero id=${id}`); - return of(HEROES.find(hero => hero.id === id)); + return of(hero); } // #enddocregion getHero }