Created
May 10, 2018 16:36
-
-
Save nerdic-coder/e5dcca4ed99380e46bb79617c422eae9 to your computer and use it in GitHub Desktop.
getHero-service.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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