Skip to content

Instantly share code, notes, and snippets.

@nerdic-coder
Created May 10, 2018 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerdic-coder/e5dcca4ed99380e46bb79617c422eae9 to your computer and use it in GitHub Desktop.
Save nerdic-coder/e5dcca4ed99380e46bb79617c422eae9 to your computer and use it in GitHub Desktop.
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