Created
October 27, 2012 20:48
-
-
Save jipiboily/3966177 to your computer and use it in GitHub Desktop.
Fixed view example for Ember's Getting Started guide
This file contains hidden or 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
// [...] | |
Todos.ListTodosView = Ember.View.extend({ | |
templateName: 'todo-list', | |
todosBinding: 'Todos.todosController' | |
}); |
This file contains hidden or 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-handlebars"> | |
{{view Todos.CreateTodoView id="new-todo" placeholder="What needs to be done?"}} | |
{{view Todos.ListTodosView}} | |
</script> | |
<script type='text/x-handlebars' data-template-name='todo-list'> | |
{{#if view.todos}} | |
<ul> | |
{{#each view.todos}} | |
<li {{bindAttr class="isDone"}}> | |
{{view Em.Checkbox checkedBinding="isDone"}} | |
{{title}} | |
</li> | |
{{/each}} | |
</ul> | |
{{/if}} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment