Created
February 10, 2012 01:08
-
-
Save tauren/1784972 to your computer and use it in GitHub Desktop.
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
var html = $('script#todo').html(); | |
var data = { | |
content: 'Todo item', | |
done: false | |
}; | |
var map = Plates.Map(); | |
map.class('todo-content').to('content'); | |
// TODO: Add mapping to render checkbox properly | |
// map setting to make the following render if done = true: | |
// <input type="checkbox" checked="checked" /> | |
// Or this if done = false: | |
// <input type="checkbox" /> | |
console.log(Plates.bind(html, data, map)); |
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
<script type="text/x-plates-tmpl" id="todo"> | |
<div class="todo"> | |
<div class="display"> | |
<input class="check" type="checkbox" /> | |
<div class="todo-content"></div> | |
<span class="todo-destroy"></span> | |
</div> | |
<div class="edit"> | |
<input class="todo-input" type="text" value="" /> | |
</div> | |
</div> | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment