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 0d7845681b..4cdf959945 100644 --- a/aio/content/examples/toh-pt5/src/app/hero.service.ts +++ b/aio/content/examples/toh-pt5/src/app/hero.service.ts @@ -19,7 +19,9 @@ export class HeroService { // #docregion getHero getHero(id: number): Observable { - const hero = HEROES.find(h => h.id === id); + // For now, assume that a hero with the specified `id` always exists. + // Error handling will be added in the next step of the tutorial. + const hero = HEROES.find(h => h.id === id) as Hero; this.messageService.add(`HeroService: fetched hero id=${id}`); return of(hero); }