angular-docs-cn/public/docs/_examples/toh-5/dart/lib/dashboard_component.dart
Ward Bell fa99a8b0b2 docs(toh-5): dashboard uses [routerLink] bindings #998 (#2718)
* docs(toh-5): dashboard uses [routerLink] bindings #998
closes #998

* chore: temp add toh-5 to bad-code-excerpt-skip-patterns.txt
2016-11-03 10:25:01 -07:00

37 lines
790 B
Dart

// #docplaster
// #docregion
// #docregion imports
import 'dart:async';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'hero_service.dart';
// #enddocregion imports
@Component(
selector: 'my-dashboard',
// #docregion templateUrl
templateUrl: 'dashboard_component.html',
// #enddocregion templateUrl
// #docregion css
styleUrls: const ['dashboard_component.css']
// #enddocregion css
)
// #docregion component
class DashboardComponent implements OnInit {
List<Hero> heroes;
// #docregion ctor
final HeroService _heroService;
DashboardComponent(this._heroService);
// #enddocregion ctor
Future<Null> ngOnInit() async {
heroes = (await _heroService.getHeroes()).skip(1).take(4).toList();
}
}
// #enddocregion component