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

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

Issue 20863002: Introduce boot.js: this finally makes it possible to load and run Todomvc (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: 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
« no previous file with comments | « example/todomvc/web/index.html ('k') | example/todomvc/web/router_options.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 model; 5 library model;
6 6
7 import 'dart:html' show CompoundBinding; 7 import 'dart:html' show CompoundBinding;
8 import 'package:observe/observe.dart';
9 import 'package:polymer/polymer.dart'; 8 import 'package:polymer/polymer.dart';
10 9
11 final appModel = new AppModel._(); 10 final appModel = new AppModel._();
12 11
13 class AppModel extends ObservableBase { 12 class AppModel extends ObservableBase {
14 final ObservableList<Todo> todos = new ObservableList<Todo>(); 13 final ObservableList<Todo> todos = new ObservableList<Todo>();
15 @observable int doneCount; 14 @observable int doneCount;
16 @observable int remaining; 15 @observable int remaining;
17 @observable List<Todo> visibleTodos; 16 @observable List<Todo> visibleTodos;
18 @observable bool hasTodos; 17 @observable bool hasTodos;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 61 }
63 62
64 class Todo extends ObservableBase { 63 class Todo extends ObservableBase {
65 @observable String task; 64 @observable String task;
66 @observable bool done = false; 65 @observable bool done = false;
67 66
68 Todo(this.task); 67 Todo(this.task);
69 68
70 String toString() => "$task ${done ? '(done)' : '(not done)'}"; 69 String toString() => "$task ${done ? '(done)' : '(not done)'}";
71 } 70 }
OLDNEW
« no previous file with comments | « example/todomvc/web/index.html ('k') | example/todomvc/web/router_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698