export abstract class FormReactive {
protected abstract formValidatorService: FormValidatorService
+ protected formChanged = false
form: FormGroup
formErrors: FormReactiveErrors
this.formErrors = formErrors
this.validationMessages = validationMessages
- this.form.valueChanges.subscribe(data => this.onValueChanged(false))
+ this.form.valueChanges.subscribe(() => this.onValueChanged(false))
}
protected onValueChanged (forceCheck = false) {
this.formErrors[ field ] = ''
const control = this.form.get(field)
+ if (control.dirty) this.formChanged = true
+
// Don't care if dirty on force check
const isDirty = control.dirty || forceCheck === true
if (control && isDirty && !control.valid) {