| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library todomvc.web.todo_row; | 5 library todomvc.web.todo_row; |
| 6 | 6 |
| 7 import 'dart:html'; |
| 7 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 8 import 'model.dart'; | 9 import 'model.dart'; |
| 9 | 10 |
| 10 @CustomTag('todo-row') | 11 @CustomTag('todo-row') |
| 11 class TodoRow extends PolymerElement { | 12 class TodoRow extends LIElement with Polymer, ObservableMixin { |
| 12 @published Todo todo; | 13 @published Todo todo; |
| 13 | 14 |
| 14 bool get applyAuthorStyles => true; | 15 bool get applyAuthorStyles => true; |
| 15 | 16 |
| 16 void created() { | 17 factory TodoRow() => new Element.tag('todo-row'); |
| 17 super.created(); | 18 |
| 19 TodoRow.created() : super.created() { |
| 20 polymerCreated(); |
| 21 |
| 18 var root = getShadowRoot("todo-row"); | 22 var root = getShadowRoot("todo-row"); |
| 19 var label = root.query('#label').xtag; | 23 var label = root.query('#label'); |
| 20 var item = root.query('.todo-item'); | 24 var item = root.query('.todo-item'); |
| 21 | 25 |
| 22 bindCssClass(item, 'completed', this, 'todo.done'); | 26 bindCssClass(item, 'completed', this, 'todo.done'); |
| 23 bindCssClass(item, 'editing', label, 'editing'); | 27 bindCssClass(item, 'editing', label, 'editing'); |
| 24 } | 28 } |
| 25 | 29 |
| 26 void removeTodo() => appModel.todos.remove(todo); | 30 void removeTodo() => appModel.todos.remove(todo); |
| 27 } | 31 } |
| OLD | NEW |