From 6d47b05b5bda1e59104126b546885c2dc410ed86 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 16 Mar 2021 23:18:31 +0200 Subject: [PATCH] docs: align `toh-pt5` code with `toh-pt4` (#41234) This commit aligns the code of `HeroService` `getHeroes()` and `getHero()` methods in `toh-pt5` with that of `toh-pt4`. I.e. it applies the changes from #40419 to `toh-pt5`. PR Close #41234 --- aio/content/examples/toh-pt5/src/app/hero.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }