docs: edit example to fetch hero before sending message (#40419)
PR Close #40419
This commit is contained in:
parent
820d95ba40
commit
2a851c0924
|
@ -26,10 +26,10 @@ export class HeroService {
|
||||||
// #docregion getHeroes, getHeroes-1
|
// #docregion getHeroes, getHeroes-1
|
||||||
getHeroes(): Observable<Hero[]> {
|
getHeroes(): Observable<Hero[]> {
|
||||||
// #enddocregion getHeroes-1
|
// #enddocregion getHeroes-1
|
||||||
// TODO: send the message _after_ fetching the heroes
|
const heroes = of(HEROES);
|
||||||
this.messageService.add('HeroService: fetched heroes');
|
this.messageService.add('HeroService: fetched heroes');
|
||||||
// #docregion getHeroes-1
|
// #docregion getHeroes-1
|
||||||
return of(HEROES);
|
return heroes;
|
||||||
}
|
}
|
||||||
// #enddocregion getHeroes, getHeroes-1
|
// #enddocregion getHeroes, getHeroes-1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue