1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

This is the code you used export class AppComponent implements OnInit { public title = 'Tour of heroes'; **public heroes = Hero[];** public selectedHero: Hero; constructor(private _heroService: HeroService) {} ngOnInit() { this.getHeroes(); } getHeroes() { this.heroes = this._heroService.getHeroes().then( heroes => this.heroes = heroes ); } onSelect(hero: Hero) { this.selectedHero = hero; } } Here the blocked code should be use as public heroes : Hero[];