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
4: Add Services
[examples/angular-tour-of-heroes]
/
src
/
app
/
heroes
/
heroes.component.ts
diff --git
a/src/app/heroes/heroes.component.ts
b/src/app/heroes/heroes.component.ts
index
94f4266
..
1e29d4e
100644
(file)
--- a/
src/app/heroes/heroes.component.ts
+++ b/
src/app/heroes/heroes.component.ts
@@
-24,6
+24,8
@@
export class HeroesComponent implements OnInit {
}
getHeroes() : void {
- this.heroes = this.heroService.getHeroes();
+ this.heroService
+ .getHeroes()
+ .subscribe(heroes => this.heroes = heroes);
}
}