Skip to content

Instantly share code, notes, and snippets.

@earnold
Last active December 11, 2015 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save earnold/4616732 to your computer and use it in GitHub Desktop.
Save earnold/4616732 to your computer and use it in GitHub Desktop.
EmberTodo.ItemController = Ember.ObjectController.extend({
completed: function(key, value) {
if (arguments.length > 1){
var item = this.get("content");
console.log("initial value");
console.log(item.get("completed"));
item.set("completed", value);
console.log("after value");
console.log(item.get("completed"));
console.log("is dirty?");
console.log(item.get("isDirty"));
item.transaction.commit();
}
return this.get('content').get('completed');
}.property('content.completed')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment