| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | // #docplaster
 | 
					
						
							|  |  |  | // #docregion imports
 | 
					
						
							| 
									
										
										
										
											2016-04-27 11:28:22 -07:00
										 |  |  | import { Component, OnInit } from '@angular/core'; | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | import { Hero } from './hero'; | 
					
						
							|  |  |  | import { HeroService } from './hero.service'; | 
					
						
							|  |  |  | // #enddocregion imports
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @Component({ | 
					
						
							|  |  |  |   selector: 'my-dashboard', | 
					
						
							|  |  |  |   templateUrl: 'app/dashboard.component.html' | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | // #docregion component
 | 
					
						
							|  |  |  | export class DashboardComponent implements OnInit { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   heroes: Hero[] = []; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-03 14:06:32 +02:00
										 |  |  |   constructor(private heroService: HeroService) { } | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   ngOnInit() { | 
					
						
							| 
									
										
										
										
											2016-05-03 14:06:32 +02:00
										 |  |  |     this.heroService.getHeroes() | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  |       .then(heroes => this.heroes = heroes.slice(1,5)); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   gotoDetail(){ /* not implemented yet */} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | // #enddocregion component
 |