Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
getHero-service.tsx
getHero(id: number): Observable<Hero> {
// TODO: send the message _after_ fetching the hero
this.messageService.add(`HeroService: fetched hero id=${id}`);
return of(HEROES.find(hero => hero.id === id));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment