are reactive forms the way to go in order to have a component that can listen for changes in the validity status of the form it contains and execute some compoment\'s method
You can do something like this do detect a validity change and execute a method based on whether the form is VALID
or INVALID
.
this.myForm.statusChanges
.subscribe(val => this.onFormValidation(val));
onFormValidation(validity: string) {
switch (validity) {
case "VALID":
// do 'form valid' action
break;
case "INVALID":
// do 'form invalid' action
break;
}
}