【发布时间】:2017-10-20 03:22:02
【问题描述】:
this.parentForm = this._fb.group({
testControl1: [],
testControl2: [],
testChildForm1: this._fb.group({
testChildControl1: [],
testChildControl2: []
})
)};
对于上面的父表单,它包含两个表单控件和一个嵌套的子表单组。
我想访问下面的子表单的值
this.parentForm.controls['testChildForm1'].controls.testChildControl1
但无法访问子窗体的控件,因为 TS 给出错误 “AbstractControl”类型上不存在属性“控件”
【问题讨论】:
标签: angular angular-reactive-forms