angular-docs-cn/public/docs/_examples/toh-5/dart/lib/dashboard_component_2.dart
Kathy Walrath 185f9a7049 docs(dart): update to b12
Also update dart_to_js_script_rewriter dependency to ^1.0.1,
and change most angular2.dart imports to be core.dart instead.

The pipes example broke without the angular2.dart import, so I let it be.

The server-communication sample has never worked for me,
so I changed it but might have broken it further.

closes #1007
2016-03-25 17:40:23 -07:00

26 lines
568 B
Dart

// #docplaster
// #docregion imports
import 'package:angular2/core.dart';
import 'hero.dart';
import 'hero_service.dart';
// #enddocregion imports
// #docregion component
@Component(
selector: 'my-dashboard',
templateUrl: 'dashboard_component.html'
)
class DashboardComponent implements OnInit {
List<Hero> heroes;
final HeroService _heroService;
DashboardComponent(this._heroService);
ngOnInit() async =>
heroes = (await _heroService.getHeroes()).getRange(1, 5).toList();
gotoDetail(){ /* not implemented yet */}
}
// #enddocregion component