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

Unified Diff: src/site/docs/tutorials/add-elements/examples/todo/todo.dart

Issue 26542002: edit pass on T3,4,5, updated images (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: merging with master Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: src/site/docs/tutorials/add-elements/examples/todo/todo.dart
diff --git a/src/site/docs/tutorials/add-elements/examples/todo/todo.dart b/src/site/docs/tutorials/add-elements/examples/todo/todo.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5698508ecc7ae54b1404d025b19940d6c0960936
--- /dev/null
+++ b/src/site/docs/tutorials/add-elements/examples/todo/todo.dart
@@ -0,0 +1,17 @@
+import 'dart:html';
+
+InputElement toDoInput;
+UListElement toDoList;
+
+void main() {
+ toDoInput = query('#to-do-input');
+ toDoList = query('#to-do-list');
+ toDoInput.onChange.listen(addToDoItem);
+}
+
+void addToDoItem(Event e) {
+ var newToDo = new LIElement();
+ newToDo.text = toDoInput.value;
+ toDoInput.value = '';
+ toDoList.children.add(newToDo);
+}

Powered by Google App Engine
This is Rietveld 408576698