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

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

Issue 23224003: move polymer.dart into dart svn (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add --deploy to todomvc sample Created 7 years, 4 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
(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 app;
6
7 import 'dart:html';
8 import 'package:polymer/polymer.dart';
9 import 'model.dart';
10
11 @CustomTag("todo-app")
12 class TodoApp extends PolymerElement with ObservableMixin {
13 @observable AppModel app;
14 bool get applyAuthorStyles => true;
15
16 void created() {
17 super.created();
18 app = appModel;
19 }
20
21 void addTodo(Event e) {
22 e.preventDefault(); // don't submit the form
23 var input = getShadowRoot('todo-app').query('#new-todo');
24 if (input.value == '') return;
25 app.todos.add(new Todo(input.value));
26 input.value = '';
27 }
28
29 void clear() => app.clearDone();
30 }
OLDNEW
« no previous file with comments | « samples/third_party/todomvc/test/todomvc_markdone_test.html ('k') | samples/third_party/todomvc/web/app.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698