我已經做了一些研究,我很驚訝地發現它並不像應該那樣直截了當。 我知道有一些使用ngModel的方法。像Bind and fetch dropdown list value in typescript and Angular2等。但我想能夠輕鬆地將我選擇的選項綁定到我的formControlName var。 這是我曾嘗試: .HTML <form id="myForm" name="father"
如果由formBuilder生成的控件有效,我需要檢查組件(不在模板中)。我想: if(this.miSpecialForm.controls.miName.dirty){
console.log('Hi mom!');
}
,但我得到的錯誤: Property 'miName' does not exist on type '{ [key: string]: AbstractContro