2175bdfae18b17e987b6f138c53ee7aec62dc6bc
[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_service.dart';
10 import 'product_category_service.dart';
11
12 @Component(
13         selector: 'my-app',
14         templateUrl: 'app_component.html',
15         //styleUrls: const ['app_component.css'],
16         directives: const [
17                 ROUTER_DIRECTIVES,
18                 MaterialLayout
19         ],
20         providers: const [
21                 ProductService,
22                 ProductCategoryService,
23                 ROUTER_PROVIDERS
24         ]
25 )
26
27 @RouteConfig(const [
28         const Route(
29                 path: '/product_categories',
30                 name: 'ProductCategories',
31                 component: ProductCategoryComponent,
32                 useAsDefault: true
33         ),
34         const Route(
35                 path: '/products_of_category/:id',
36                 name: 'Products',
37                 component: ProductComponent
38         ),
39         const Route(
40                 path: '/product/:id',
41                 name: 'ProductDetail',
42                 component: ProductDetailComponent
43         )
44 ])
45
46 class AppComponent {
47         String title = 'Tavern 2';
48
49         @ViewChild(MaterialLayout)
50         MaterialLayout layout;
51
52 }
53