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

Side by Side Diff: third_party/pkg/angular/demo/todo/todo.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 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;
41 init(TodoController todo) { } 40 init(TodoController todo) { }
42 } 41 }
43 42
44 43
45 @NgDirective( 44 @NgDirective(
46 selector: '[todo-controller]', 45 selector: '[todo-controller]',
47 publishAs: 'todo' 46 publishAs: 'todo'
48 ) 47 )
49 class TodoController { 48 class TodoController {
50 List<Item> items; 49 List<Item> items;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 84 }
86 85
87 String classFor(Item item) { 86 String classFor(Item item) {
88 return item.done ? 'done' : ''; 87 return item.done ? 'done' : '';
89 } 88 }
90 89
91 int remaining() { 90 int remaining() {
92 return items.where((item) => !item.done).length; 91 return items.where((item) => !item.done).length;
93 } 92 }
94 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698