Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: example/todomvc/web/todo_row.dart

Issue 19497002: Reducing the amount of code we generate in the compiler: We still continue (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 todo_row; 5 library todo_row;
6 6
7 import 'package:observe/observe.dart'; 7 import 'package:observe/observe.dart';
8 import 'package:polymer/polymer.dart'; 8 import 'package:polymer/polymer.dart';
9 import 'model.dart'; 9 import 'model.dart';
10 10
11 class TodoRow extends PolymerElement with ObservableMixin { 11 class TodoRow extends PolymerElement with ObservableMixin {
12 @observable Todo todo; 12 @observable Todo todo;
13 13
14 bool get applyAuthorStyles => true;
14 ScopedCssMapper get css => getScopedCss("todo-row"); 15 ScopedCssMapper get css => getScopedCss("todo-row");
15 16
16 created() { 17 created() {
17 super.created(); 18 super.created();
18 var root = getShadowRoot("todo-row"); 19 var root = getShadowRoot("todo-row");
19 var label = root.query('#label').xtag; 20 var label = root.query('#label').xtag;
20 var item = root.query('.' + css['.todo-item']); 21 var item = root.query('.' + css['.todo-item']);
21 22
22 bindCssClass(item, css['.completed'], this, 'todo.done'); 23 bindCssClass(item, css['.completed'], this, 'todo.done');
23 bindCssClass(item, css['.editing'], label, 'editing'); 24 bindCssClass(item, css['.editing'], label, 'editing');
24 } 25 }
25 26
26 void removeTodo() => appModel.todos.remove(todo); 27 void removeTodo() => appModel.todos.remove(todo);
27 } 28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698