Hi, I have a form for editing attributes of a model “video”. This form is modal and includes validation of form fields. If validations are successful, it will update the record on the server API. The problem is that the background of modal displays a list of video titles, and when I edit a title, the background shows the new title simultaneously. It looks bad. But regarding the principle, is it possible to show in the template only attributes that are not “dirty”? So far I have handled this situation quite hard by creating a new object, copying “video” model attributes and if the validation was successful, so I copied the changed attributes back into “video” model and call model.save(). This concept seems to me bad, therefore I´d like to ask how you handle things like that. Thanks
https://github.com/DockYard/ember-changeset will help you with this (it can also do validations if you add its companion, https://github.com/DockYard/ember-changeset-validations/).
Thank you very. This works perfectly, it took some time to implemented it in my code, but it is a nice solution.