lundi 4 mai 2015

Restore an old version of a model in EmberJS

I've code an autosave pattern on my Post model, every 10 seconds, if no change has been made my model is automatically saved on the server.

Now, I want to create a "cancel" button on my edit page. When I click on it, I want to cancel all of my change on the model. Because of the autosave, my model is already saved on the database...

What do you think of the best method I can do? I've tried to create a variable with my model when I'm going to the edit's page and then use this variable to overwrite the current model when I cancel but it didn't work.

Thanks for your help.




Aucun commentaire:

Enregistrer un commentaire