OLD | NEW |
---|---|
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 Loading... | |
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; | |
Jennifer Messerly
2013/11/08 01:54:02
upstream this fix?
danrubel
2013/11/08 01:55:34
Good point!
| |
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 Loading... | |
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 } |
OLD | NEW |