I have a form that looks like this:
form = formGroup({
name:FormControl(''),
adress:new FormGroup({
city: new FOrmControl(''),
})
})
and I use two components
parent:
<form [formGroup]="form" (ngSubmit)="submit()">
<input matInput formControlName="name">
<child-component [group]="form.controls.adress"><child-component/>
</form>
child:
<form [formGroup]="group">
<input matInput formControlName="city">
</form>
Now my problem is that when I submit the form and city
is invalid, the red underline doesn’t show.
How can submit have an effect on both parent and child?