I have implemented Angular Reactive Forms FormGroup and FormArray in my project. The issue I am facing is related to splitting my form fields into child components and passing the parent form controls to them. I expected this to be a straightforward process, but I am encountering difficulties. My main FormGroup is named 'binsForm', and in my template, I am including the child component like this:
<app-child [parent]="binsForm"></app-child>
Within the child component, I have defined an @Input property:
@Input() parent: FormGroup;
Subsequently, I am referencing this input in the child template:
<div class="fields-wrap" [formGroup]="parent">
<div class="input-wrap">
<label>Bin ID <span>*</span><input type="text" formControlName="id"></label>
</div>
<div class="clearfix"></div>
</div>
Upon examining the StackBlitz provided, you will notice that upon clicking 'edit quality', the console displays the message 'Cannot find control with the name id.'
Despite following a tutorial on this approach, I am unable to pinpoint the reason why the child component cannot locate the form group.