angular-restmod icon indicating copy to clipboard operation
angular-restmod copied to clipboard

DirtyModel mixin when $build-ing records

Open smashercosmo opened this issue 10 years ago • 1 comments

It seems, that you can't use DirtyModel mixin for a newly built records (before record was saved). Real life use case: you want to show warning popup about unsaved data, when user typed anything in the "New Post" form and trying to leave page. So when user opens this form we $build a new record for the post and we want to check when this new record becomes dirty.

smashercosmo avatar Sep 15 '14 08:09 smashercosmo

Hmm, you are right, the initial design was intended only to compare changes with already persisted data. I'll take a look to see if usage can be extended to what you propose.

iobaixas avatar Sep 16 '14 01:09 iobaixas