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

Side by Side Diff: dart/samples/third_party/angular_todo/todo.dart

Issue 66253002: Version 0.8.10.9 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 library todo; 1 library todo;
2 2
3 import 'package:angular/angular.dart'; 3 import 'package:angular/angular.dart';
4 4
5 class Item { 5 class Item {
6 String text; 6 String text;
7 bool done; 7 bool done;
8 8
9 Item([String this.text = '', bool this.done = false]); 9 Item([String this.text = '', bool this.done = false]);
10 10
(...skipping 19 matching lines...) Expand all
30 todo.items.add(new Item(d["text"], d["done"])); 30 todo.items.add(new Item(d["text"], d["done"]));
31 }); 31 });
32 }); 32 });
33 } 33 }
34 } 34 }
35 35
36 // An implementation of ServerController that does nothing. 36 // An implementation of ServerController that does nothing.
37 // Logic in main.dart determines which implementation we should 37 // Logic in main.dart determines which implementation we should
38 // use. 38 // use.
39 class NoServerController implements ServerController { 39 class NoServerController implements ServerController {
40 Http _http;
40 init(TodoController todo) { } 41 init(TodoController todo) { }
41 } 42 }
42 43
43 44
44 @NgDirective( 45 @NgDirective(
45 selector: '[todo-controller]', 46 selector: '[todo-controller]',
46 publishAs: 'todo' 47 publishAs: 'todo'
47 ) 48 )
48 class TodoController { 49 class TodoController {
49 List<Item> items; 50 List<Item> items;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 84 }
84 85
85 String classFor(Item item) { 86 String classFor(Item item) {
86 item.done ? 'done' : ''; 87 item.done ? 'done' : '';
87 } 88 }
88 89
89 int remaining() { 90 int remaining() {
90 return items.where((item) => !item.done).length; 91 return items.where((item) => !item.done).length;
91 } 92 }
92 } 93 }
OLDNEW
« no previous file with comments | « dart/samples/third_party/angular_todo/pubspec.yaml ('k') | dart/samples/third_party/dromaeo/Dromaeo.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698