I am using FormGroup
, custom validators, etc. I need to capture in an event handler when the form becomes valid/invalid, not a property, but an actual event in TypeScript code.
I took a look to the documentation, but I wasn't able to find something like: (validityChange)="myEventHandler($event)"
where validityChange
is just a placeholder for the name of the actual event I am looking for.
Subscribe to statusChanges
this.myForm.statusChanges
.filter(s => s == 'VALID')
.subscribe(val => onValid())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With