I need to check in the component (not in the template) if a control generated by formBuilder is valid. I tried:
if(this.miSpecialForm.controls.miName.dirty){
console.log('Hi mom!');
}
but I get the error:
Property 'miName' does not exist on type '{ [key: string]: AbstractControl; }'
The touched property is used to report that the control or the form is touched or not.
this.miSpecialForm.get('miName').valid
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