How to check if form control is valid in Angular programatically?

Viewed 23930

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; }'
2 Answers
Related