|
1 | 1 | // #docplaster
|
2 | 2 | // #docregion
|
3 | 3 | import 'package:angular2/core.dart';
|
| 4 | +// #docregion import-router |
4 | 5 | import 'package:angular2/router.dart';
|
| 6 | +// #enddocregion import-router |
5 | 7 |
|
6 |
| -import 'package:angular2_tour_of_heroes/heroes_component.dart'; |
7 |
| -import 'package:angular2_tour_of_heroes/hero_service.dart'; |
8 |
| -import 'package:angular2_tour_of_heroes/dashboard_component.dart'; |
9 |
| -// #docregion hero-detail-import |
10 |
| -import 'package:angular2_tour_of_heroes/hero_detail_component.dart'; |
11 |
| -// #enddocregion hero-detail-import |
| 8 | +import 'dashboard_component.dart'; |
| 9 | +import 'hero_detail_component.dart'; |
| 10 | +import 'hero_service.dart'; |
| 11 | +import 'heroes_component.dart'; |
12 | 12 |
|
13 | 13 | @Component(
|
14 | 14 | selector: 'my-app',
|
15 |
| - // #docregion template |
| 15 | + // #docregion template, template-v3 |
16 | 16 | template: '''
|
17 | 17 | <h1>{{title}}</h1>
|
18 | 18 | <nav>
|
19 | 19 | <a [routerLink]="['Dashboard']">Dashboard</a>
|
20 | 20 | <a [routerLink]="['Heroes']">Heroes</a>
|
21 | 21 | </nav>
|
22 | 22 | <router-outlet></router-outlet>''',
|
23 |
| - // #enddocregion template |
24 |
| - // #docregion style-urls |
| 23 | + // #enddocregion template, template-v3 |
| 24 | + // #docregion styleUrls |
25 | 25 | styleUrls: const ['app_component.css'],
|
26 |
| - // #enddocregion style-urls |
| 26 | + // #enddocregion styleUrls |
| 27 | + // #docregion directives-and-providers |
27 | 28 | directives: const [ROUTER_DIRECTIVES],
|
28 | 29 | providers: const [HeroService, ROUTER_PROVIDERS])
|
| 30 | +// #enddocregion directives-and-providers |
| 31 | +// #docregion heroes |
29 | 32 | @RouteConfig(const [
|
30 |
| - // #docregion dashboard-route |
| 33 | + // #enddocregion heroes |
| 34 | + // #docregion dashboard |
31 | 35 | const Route(
|
32 | 36 | path: '/dashboard',
|
33 | 37 | name: 'Dashboard',
|
34 | 38 | component: DashboardComponent,
|
35 | 39 | useAsDefault: true),
|
36 |
| - // #enddocregion dashboard-route |
37 |
| - // #docregion hero-detail-route |
| 40 | + // #enddocregion dashboard |
| 41 | + // #docregion hero-detail |
38 | 42 | const Route(
|
39 | 43 | path: '/detail/:id', name: 'HeroDetail', component: HeroDetailComponent),
|
40 |
| - // #enddocregion hero-detail-route |
| 44 | + // #enddocregion hero-detail |
| 45 | + // #docregion heroes |
41 | 46 | const Route(path: '/heroes', name: 'Heroes', component: HeroesComponent)
|
42 | 47 | ])
|
| 48 | +// #enddocregion heroes |
43 | 49 | class AppComponent {
|
44 | 50 | String title = 'Tour of Heroes';
|
45 | 51 | }
|
0 commit comments