| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  | // #docplaster
 | 
					
						
							|  |  |  | // #docregion
 | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  | // #docregion imports
 | 
					
						
							| 
									
										
										
										
											2016-06-15 07:46:26 -07:00
										 |  |  | import 'dart:async'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-25 16:03:53 -07:00
										 |  |  | import 'package:angular2/core.dart'; | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | import 'hero.dart'; | 
					
						
							|  |  |  | import 'hero_service.dart'; | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  | // #enddocregion imports
 | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | @Component( | 
					
						
							|  |  |  |     selector: 'my-dashboard', | 
					
						
							| 
									
										
										
										
											2016-08-17 13:31:40 -07:00
										 |  |  |     // #docregion templateUrl
 | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  |     templateUrl: 'dashboard_component.html', | 
					
						
							| 
									
										
										
										
											2016-08-17 13:31:40 -07:00
										 |  |  |     // #enddocregion templateUrl
 | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  |     // #docregion css
 | 
					
						
							|  |  |  |     styleUrls: const ['dashboard_component.css'] | 
					
						
							|  |  |  |     // #enddocregion css
 | 
					
						
							| 
									
										
										
										
											2016-06-15 07:46:26 -07:00
										 |  |  |     ) | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  | // #docregion component
 | 
					
						
							|  |  |  | class DashboardComponent implements OnInit { | 
					
						
							|  |  |  |   List<Hero> heroes; | 
					
						
							| 
									
										
										
										
											2016-06-15 07:46:26 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // #docregion ctor
 | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  |   final HeroService _heroService; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  |   DashboardComponent(this._heroService); | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-15 07:46:26 -07:00
										 |  |  |   // #enddocregion ctor
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Future<Null> ngOnInit() async { | 
					
						
							| 
									
										
										
										
											2016-06-28 13:15:29 -07:00
										 |  |  |     heroes = (await _heroService.getHeroes()).skip(1).take(4).toList(); | 
					
						
							| 
									
										
										
										
											2016-06-15 07:46:26 -07:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-03-16 14:39:06 -04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  | // #enddocregion component
 |