0
votes

For some reason I can't get ember-cli to perform a rollback. The model data comes in fine and I can see it getting dirty in the Ember Inspector, but rollback doesn't work. I get "undefined is not a function."

I have this in the controller:

actions: {
    revertChanges: function() {
        this.get('model').rollback();
    }
}

Do I need to import something extra? I'm using Ember : 1.10.0, Ember Data : 1.0.0-beta.15

1

1 Answers

0
votes

I guess for an ArrayController you need to iterate through each item. I fixed it by doing this:

actions: {
    cancel: function() {
        this.get('model').forEach(function(item) {              
            item.rollback();
        });
    }
}