| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | // #docplaster
 | 
					
						
							|  |  |  | // #docregion
 | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  | // #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'; | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  | // #enddocregion imports
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // #docregion metadata
 | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | @Component({ | 
					
						
							| 
									
										
										
										
											2016-09-25 18:51:54 -07:00
										 |  |  |   moduleId: module.id, | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  |   selector: 'my-dashboard', | 
					
						
							| 
									
										
										
										
											2016-09-25 18:51:54 -07:00
										 |  |  |   templateUrl: 'dashboard.component.html', | 
					
						
							| 
									
										
										
										
											2016-10-14 01:41:57 +02:00
										 |  |  |   // #enddocregion metadata
 | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  |   // #docregion css
 | 
					
						
							| 
									
										
										
										
											2016-09-25 18:51:54 -07:00
										 |  |  |   styleUrls: [ 'dashboard.component.css' ] | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  |   // #enddocregion css
 | 
					
						
							| 
									
										
										
										
											2016-10-14 01:41:57 +02:00
										 |  |  |   // #docregion metadata
 | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | }) | 
					
						
							| 
									
										
										
										
											2016-10-14 01:41:57 +02:00
										 |  |  | // #enddocregion metadata
 | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  | // #docregion class
 | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | export class DashboardComponent implements OnInit { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   heroes: Hero[] = []; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-10 09:37:33 -07:00
										 |  |  |   // #docregion ctor
 | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  |   constructor(private heroService: HeroService) { } | 
					
						
							| 
									
										
										
										
											2016-06-10 09:37:33 -07:00
										 |  |  |   // #enddocregion ctor
 | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-27 15:00:59 +02:00
										 |  |  |   ngOnInit(): void { | 
					
						
							| 
									
										
										
										
											2016-05-03 14:06:32 +02:00
										 |  |  |     this.heroService.getHeroes() | 
					
						
							| 
									
										
										
										
											2016-06-08 01:06:25 +02:00
										 |  |  |       .then(heroes => this.heroes = heroes.slice(1, 5)); | 
					
						
							| 
									
										
										
										
											2015-12-23 09:42:57 -08:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  | // #enddocregion class
 |