-
-
Save cloke/4616769 to your computer and use it in GitHub Desktop.
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
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(); | |
} | |
var t = this; | |
Em.run.next( function(){ | |
console.log( t.get('content').get('completed') ); | |
}); | |
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