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

Side by Side Diff: samples/third_party/todomvc/web/editable_label.dart

Issue 26967004: add @MirrorsUsed to observe/polymer/polymer_exprs pkgs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo in comment Created 7 years, 2 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 | Annotate | Revision Log
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 todomvc.web.editable_label; 5 library todomvc.web.editable_label;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'package:polymer/polymer.dart'; 8 import 'package:polymer/polymer.dart';
9 9
10 /** 10 /**
11 * Label whose [value] can be edited by double clicking. When editing, it 11 * Label whose [value] can be edited by double clicking. When editing, it
12 * displays a form and input element, otherwise it displays the label. 12 * displays a form and input element, otherwise it displays the label.
13 */ 13 */
14 // For illustration purposes this type uses Polymer.register instead of
15 // CustomTag. We must mark it @reflectable to ensure its members
16 // (the event handlers) are preserved and can be referenced from HTML.
17 @reflectable
14 class EditableLabel extends PolymerElement { 18 class EditableLabel extends PolymerElement {
15 @observable bool editing = false; 19 @observable bool editing = false;
16 @published String value = ''; 20 @published String value = '';
17 21
18 factory EditableLabel() => new Element.tag('editable-label'); 22 factory EditableLabel() => new Element.tag('editable-label');
19 23
20 EditableLabel.created() : super.created(); 24 EditableLabel.created() : super.created();
21 25
22 bool get applyAuthorStyles => true; 26 bool get applyAuthorStyles => true;
23 27
(...skipping 23 matching lines...) Expand all
47 if (e.keyCode == KeyCode.ESC) { 51 if (e.keyCode == KeyCode.ESC) {
48 editing = false; 52 editing = false;
49 } 53 }
50 } 54 }
51 } 55 }
52 56
53 @initMethod 57 @initMethod
54 void _init() { 58 void _init() {
55 Polymer.register('editable-label', EditableLabel); 59 Polymer.register('editable-label', EditableLabel);
56 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698