I'm trying to create a 3 level nested form that looks like this: (stackblitz link below)
form = this.formBuilder.group({
parentControl1: [''],
parentControl2: [''],
child1Group: this.formBuilder.group({
child1Control1: [''],
child1Control2: [''],
child2Group: this.formBuilder.group({
child2Control1: [''],
child2Control2: [''],
}),
}),
});
There are 3 components: parent, child1 and child2 that are nested. the above form is declared inside the parent. If I omit child2, everything works fine, but with child2 I get this error:
Cannot find control with name: 'child2Group'
Here's a stackblitz to demonstrate the issue with minimal code: link
Thanks.