Skip to content

Instantly share code, notes, and snippets.

@tylerwillingham
Last active August 29, 2015 13:58
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 tylerwillingham/9966193 to your computer and use it in GitHub Desktop.
Save tylerwillingham/9966193 to your computer and use it in GitHub Desktop.
Trying to see if I'm doing something wrong since bind-attr doesn't appear to be working as expected..
{{#each}}
<li {{bind-attr class="isCompleted:completed"}}>
<input type="checkbox" class="toggle">
<label>{{title}}</label><button class="destroy"></button>
</li>
{{/each}}
Todos.Todo = DS.Model.extend({
title: DS.attr('string'),
isComplete: DS.attr('boolean')
});
Todos.Todo.FIXTURES = [
{
id: 1,
title: 'Learn Ember.js',
isCompleted: true
},
{
id: 2,
title: '...',
isCompleted: false
},
{
id: 3,
title: 'Profit!',
isCompleted: false
}
];
<ul id="todo-list">
<script id="metamorph-3-start" type="text/x-placeholder"></script><script id="metamorph-0-start" type="text/x-placeholder"></script>
<li class="" data-bindattr-1="1">
<input type="checkbox" class="toggle">
<label><script id="metamorph-4-start" type="text/x-placeholder"></script>Learn Ember.js<script id="metamorph-4-end" type="text/x-placeholder"></script></label><button class="destroy"></button>
</li>
<script id="metamorph-0-end" type="text/x-placeholder"></script><script id="metamorph-1-start" type="text/x-placeholder"></script>
<li class="" data-bindattr-2="2">
<input type="checkbox" class="toggle">
<label><script id="metamorph-5-start" type="text/x-placeholder"></script>...<script id="metamorph-5-end" type="text/x-placeholder"></script></label><button class="destroy"></button>
</li>
<script id="metamorph-1-end" type="text/x-placeholder"></script><script id="metamorph-2-start" type="text/x-placeholder"></script>
<li class="" data-bindattr-3="3">
<input type="checkbox" class="toggle">
<label><script id="metamorph-6-start" type="text/x-placeholder"></script>Profit!<script id="metamorph-6-end" type="text/x-placeholder"></script></label><button class="destroy"></button>
</li>
<script id="metamorph-2-end" type="text/x-placeholder"></script><script id="metamorph-3-end" type="text/x-placeholder"></script>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment