Skip to content

Instantly share code, notes, and snippets.

@jipiboily
Created October 27, 2012 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jipiboily/3966177 to your computer and use it in GitHub Desktop.
Save jipiboily/3966177 to your computer and use it in GitHub Desktop.
Fixed view example for Ember's Getting Started guide
// [...]
Todos.ListTodosView = Ember.View.extend({
templateName: 'todo-list',
todosBinding: 'Todos.todosController'
});
<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