I have a reactive form that I want to detect changes for. For example, when a user views a product, a "view product" page opens filling in all form fields with the details of that product. If a change is made to any value in the form, I want a "Save" button to be enabled (it is disabled by default). However, if the user undos the changes or reverts back to what it was on load, the Save button will be disabled again.
Is this possible? I've seen some people do it where angular detects form changes and makes the form "dirty" but once the form has been dirtied it isn't easy or intuitive to change the state back to pristine. I've also read where people load the initial product details into local storage and compare the form values JSON of the current state to the local storage JSON and enable/disable buttons based on that. Does anyone have a preferred or better method?
Thanks