Skip to content

Instantly share code, notes, and snippets.

@sgharms
Created June 14, 2013 01:50
Show Gist options
  • Save sgharms/5778875 to your computer and use it in GitHub Desktop.
Save sgharms/5778875 to your computer and use it in GitHub Desktop.
Comparing to: http://localhost:4567/guides/getting-started/toggle-todo-editing-state I'm doing this on rails with the asset pipeline in an effort to play with Ember 1 some more before we do our upgrade at the end of the quarter. I was following along fine until I hit this one. I don't understand the magic of itemController enough but...it seems …
1 {{#each controller itemController="todo"}}
2 <li {{bindAttr class="isCompleted:completed isEditing:editing"}}>
3 {{#if isEditing}}
4 <input class="edit">
5 {{else}}
6 {{view Ember.Checkbox checkedBinding="isCompleted" class="toggle"}}
7 {{log this.constructor}}
8 {{log this.content.title}}
9 <!-- DOES NOT WORK
10 <label {{action "editTodo" on="doubleClick"}}>{{title}}</label><button class="destroy">>
11 -->
12 <!-- works! --> <label {{action "editTodo" on="doubleClick"}}>{{this.content.title}}</label><button class>
13 {{/if}}
14 </li>
15 {{/each}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment