| 
									
										
										
										
											2016-08-12 11:21:16 -07:00
										 |  |  | // #docregion
 | 
					
						
							| 
									
										
										
										
											2016-06-28 13:12:49 -07:00
										 |  |  | import 'dart:async'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import 'package:angular2/core.dart'; | 
					
						
							|  |  |  | import 'package:angular2/router.dart'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import 'hero.dart'; | 
					
						
							|  |  |  | import 'hero_service.dart'; | 
					
						
							| 
									
										
										
										
											2016-08-12 11:21:16 -07:00
										 |  |  | // #docregion search
 | 
					
						
							| 
									
										
										
										
											2016-08-02 09:59:35 -07:00
										 |  |  | import 'hero_search_component.dart'; | 
					
						
							| 
									
										
										
										
											2016-06-28 13:12:49 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | @Component( | 
					
						
							|  |  |  |     selector: 'my-dashboard', | 
					
						
							|  |  |  |     templateUrl: 'dashboard_component.html', | 
					
						
							| 
									
										
										
										
											2016-08-02 09:59:35 -07:00
										 |  |  |     styleUrls: const ['dashboard_component.css'], | 
					
						
							|  |  |  |     directives: const [HeroSearchComponent]) | 
					
						
							|  |  |  | // #enddocregion search
 | 
					
						
							| 
									
										
										
										
											2016-06-28 13:12:49 -07:00
										 |  |  | class DashboardComponent implements OnInit { | 
					
						
							|  |  |  |   List<Hero> heroes; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   final HeroService _heroService; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-03 10:25:01 -07:00
										 |  |  |   DashboardComponent(this._heroService); | 
					
						
							| 
									
										
										
										
											2016-06-28 13:12:49 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   Future<Null> ngOnInit() async { | 
					
						
							|  |  |  |     heroes = (await _heroService.getHeroes()).skip(1).take(4).toList(); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } |