Created
August 3, 2011 05:34
-
-
Save peterwmwong/1121973 to your computer and use it in GitHub Desktop.
Cell Rendering: HTML-ish/HAML-ish (pick your poison)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HAML-ish | |
define | |
render: (_)-> [ | |
_ 'input#newtodo', type:'text', placeholder:'... new todo' | |
_ 'ul.todos', | |
for todo in window.todoList | |
_ 'li', todo | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HAML-ish | |
define({ | |
render: function(_) { return [ | |
_('#newtodo', {type:'text',placeholder:'... new todo'}), | |
_('ul.todos', | |
window.todoList.map(function(todo){ | |
return _('li', todo); | |
}) | |
) | |
]; } | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HTML-ish | |
define | |
render: (_)-> [ | |
_ '<input id="newtodo" type="text" placeholder="... new todo">' | |
_ '<ul class="todos">', | |
for todo in window.todoList | |
_ '<li>', todo | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTML-ish | |
define({ | |
render: function(_) { return [ | |
_('<input id="newtodo" type="text" placeholder="... new todo">'), | |
_('<ul class="todos">', | |
window.todoList.map(function(todo){ | |
return _('<li>', todo); | |
}) | |
) | |
];} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
window.todoList = ['one','two','three','four']; | |
--> | |
<input id="newtodo" type="text" placeholder="... new todo"></input> | |
<ul class="todos"> | |
<li>one</li> | |
<li>two</li> | |
<li>three</li> | |
<li>four</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment