如何以编程方式检查 formcontrol 在 Angular 中是否有效?

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

如果 formBuilder 生成的控件有效,我需要检查组件(而不是模板)。我试过了:

if(this.miSpecialForm.controls.miName.dirty){
 console.log('Hi mom!');
}

但我收到错误消息:

Property 'miName' does not exist on type '{ [key: string]: AbstractControl; }'
this.miSpecialForm.get('miName').valid
if(this.miSpecialForm.controls['miName'].valid){
     console.log('Hi mom!');
}