initial checkin
[outofuni/tavern2.git] / lib / app_component.dart
1 import 'package:angular2/core.dart';
2 import 'package:angular2/router.dart';
3
4 import 'package:angular2_rbi/directives.dart';
5
6 import 'product_component.dart';
7 import 'product_category_component.dart';
8 import 'product_detail_component.dart';
9 import 'product_category_detail_component.dart';
10 import 'product_service.dart';
11 import 'product_category_service.dart';
12
13 @Component(
14         selector: 'my-app',
15         templateUrl: 'app_component.html',
16         //styleUrls: const ['app_component.css'],
17         directives: const [
18                 ROUTER_DIRECTIVES,
19                 MaterialLayout
20         ],
21         providers: const [
22                 ProductService,
23                 ProductCategoryService,
24                 ROUTER_PROVIDERS
25         ]
26 )
27
28 @RouteConfig(const [
29         const Route(
30                 path: '/product_categories',
31                 name: 'ProductCategories',
32                 component: ProductCategoryComponent,
33                 useAsDefault: true
34         ),
35         const Route(
36                 path: '/products_of_category/:id',
37                 name: 'Products',
38                 component: ProductComponent
39         ),
40         const Route(
41                 path: '/product/:id',
42                 name: 'ProductDetail',
43                 component: ProductDetailComponent
44         ),
45         const Route(
46                 path: '/product_category/:id',
47                 name: 'ProductCategoryDetail',
48                 component: ProductCategoryDetailComponent
49         )
50 ])
51
52 class AppComponent {
53         String title = 'Tavern 2';
54
55         @ViewChild(MaterialLayout)
56         MaterialLayout layout;
57
58 }
59