Angular 以角度获取嵌套的反应形式值?

Angular 以角度获取嵌套的反应形式值?,angular,forms,typescript,Angular,Forms,Typescript,我有一个类似于以下内容的嵌套表单: profileForm = new FormGroup({ firstName: new FormControl(''), lastName: new FormControl(''), address: new FormGroup({ street: new FormControl(''), city: new FormControl(''), date1: new FormControl(''), date2: n

我有一个类似于以下内容的嵌套表单:

profileForm = new FormGroup({
  firstName: new FormControl(''),
  lastName: new FormControl(''),
  address: new FormGroup({
    street: new FormControl(''),
    city: new FormControl(''),
    date1: new FormControl(''),
    date2: new FormControl('')
  })
});
我试图将
date2
mindate设置为
date1
值,如下所示:

<mat-form-field class="datepickerformfield" floatLabel="never">
    <input matInput class="dp" formControlName="date2" [min]="profileform.controls['date1'].value" [matDatepicker]="date2" placeholder="DD/MM/AAAA" >
</mat-form-field>

但我有一个错误:

无法读取未定义的属性“值”

如何使用
profileform
对象获取
date1
值?

最终通过以下方法解决:

[min]="profileform.get('address.date1').value"

处理Angular6+

表单有一个名为
value
的am成员,它反映了表单结构,但只包含值。
要访问日期,您只需调用
[min]=“profileform.value.address.date1”

您可以在stackbiltz
profileform.get('address').get('date1')中共享它吗
[min]=“profileform.get('address')。get('address')。get('date1')。value“
[min]=“profileform.get('address.date1')。value”
[min]="profileform.controls[address].controls['date1'].value"
[min]="profileform.get('address.date1').value"