Proxy object for easy rollbacks.
var FooController = Ember.ObjectController.extend({
bufferedContent: function() {
return Em.ObjectProxy.extend(BufferedProxy).create({
content: this.get('content')
});
}.property('content'),
actions: {
save: function() {
this.get('bufferedContent').applyBufferedChanges();
},
cancel: function() {
this.get('bufferedContent').discardBufferedChanges();
}
}
});
Written by Kris Selden for Yapp Labs, published by Luke Melia.