Skip to content
Browse files

update todo to use the partial event binding

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
1 parent a34fcf7 commit 9743cbc8284b0f1ffacb20490bde18fe99acb911 @ibdknox committed Sep 26, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 examples/todo.cljs
View
5 examples/todo.cljs
@@ -33,16 +33,17 @@
[:ul
(map todo-item @todos)]]))
-(pe/on (dom/query "#todoForm") :submit
+(pe/on todo-form :submit
(fn [me e]
(let [text (dom/val (dom/query "#todoText"))
neue (add-todo text)]
(dom/append (dom/query "ul") (todo-item neue))
(pe/prevent e))))
-(pe/on (dom/query "a.remove") :click
+(pe/on todo-item :click
(fn [me e]
(let [id (dom/attr me :id)]
(remove-todo id)
(dom/unappend me)
(pe/prevent e))))
+

0 comments on commit 9743cbc

Please sign in to comment.
Something went wrong with that request. Please try again.