vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

Local Model is updated when error occurs with onaftersave #529

Closed westerncj closed 8 years ago

westerncj commented 8 years ago

We wanted to return server side errors to the client so we used onaftersave instead of onbeforesave. It works as expected for validation except that the local model is updated when you click the Cancel button. Is there a way to not update the local model if there is an error with onaftersave?

ckosloski commented 8 years ago

I think you would have to save the before values in a temp scope variable and if you click cancel after onaftersave was run, then reset the value.

westerncj commented 8 years ago

OK. That's kind of what I ended up doing. Thanks for the quick response.

ckosloski commented 8 years ago

OK, should this issue be closed then?

ckosloski commented 8 years ago

You need to close it.