OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library book_component; |
| 6 |
| 7 import 'package:angular/angular.dart'; |
| 8 import 'book.dart' show Book; |
| 9 |
| 10 @NgComponent( |
| 11 selector: 'book-component', |
| 12 templateUrl: './book_component.html', |
| 13 publishAs: 'cmp' |
| 14 ) |
| 15 class BookComponent { |
| 16 @NgTwoWay('book-map') |
| 17 Map<String, Book> bookMap; |
| 18 String _bookId; |
| 19 |
| 20 BookComponent(RouteProvider routeProvider) { |
| 21 _bookId = routeProvider.parameters['bookId']; |
| 22 } |
| 23 |
| 24 Book get book => bookMap[_bookId]; |
| 25 } |
OLD | NEW |