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
2: Display a List
[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
2bb7a69
..
a09ff13
100644
(file)
--- a/
src/app/heroes/heroes.component.ts
+++ b/
src/app/heroes/heroes.component.ts
@@
-11,10
+11,11
@@
export class HeroesComponent implements OnInit {
heroes = HEROES;
- hero: Hero = {
- id: 1,
- name: 'Windstorm',
- };
+ selectedHero : Hero;
+
+ onSelect(hero : Hero): void {
+ this.selectedHero = hero;
+ }
constructor() { }