projects
/
examples
/
angular-tour-of-heroes
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
5: Add In-app Navigation
[examples/angular-tour-of-heroes]
/
src
/
app
/
hero.service.ts
diff --git
a/src/app/hero.service.ts
b/src/app/hero.service.ts
index
8df8f33
..
9003fe1
100644
(file)
--- a/
src/app/hero.service.ts
+++ b/
src/app/hero.service.ts
@@
-16,4
+16,9
@@
export class HeroService {
this.messageService.add('HeroService: fetching heroes...');
return of(HEROES);
}
+
+ getHero(id: number): Observable<Hero> {
+ this.messageService.add(`HeroService: fetched hero id=${id}`);
+ return of(HEROES.find(hero => hero.id === id));
+ }
}