Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. template() {
  2. return [
  3. div => [
  4. header => [
  5. h1 => ["Example " + this.title]
  6. ]
  7. ],
  8. div => ["#main",
  9. $if => [this.todos.length > 0,
  10. div => [
  11. span => [".counter", "There are " + this.todos.length + " todos!"]
  12. ]
  13. ],
  14. ul => [".todos",
  15. $forEach => [this.todos, (todo, index) =>
  16. li => ['.todo',
  17. h2 => ["A todo!"],
  18. span => [index + ": " + todo]
  19. ]
  20. ]
  21. ],
  22. form => [{id: this.formId, method: "post", action: "#"},
  23. div => [".form-control",
  24. input => [{name: "first_name", type: "text"}]
  25. ],
  26. button => [{type: "submit", onClick: this.click},
  27. "Submit!"
  28. ]
  29. ]
  30. ]
  31. ]
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement