I have a form with few data fields and two buttons.I want to enable the buttons only if the user makes some changes to the form. I have tried using:
this.for
I use some trick for my code, i think this not the best solution but somehow it's work for me.
profile.component.ts:
tempForm: any
ngOnInit() {
this.loadForm();
this.tempForm = this.form.value
}
save(): void {
if (this.tempForm === this.form.value) {
// Do Save
} else {
// Value is Same as initial
}
}
hope this solve your question, or maybe just give some inspiration.