I have form with form controls in component A. I've decided to move some form controls to separate component B in order to prevent code duplicates in other components.
A.html:
<form [formGroup]="editForm">
<B [formControllerName]="'name'" ></B>
<!-- Other form controls -->
</form>
B.html:
<select class="form-select" formControlName="{{formControllerName}}">
<!-- Options -->
</select>
I got this error: Error: NG01050: formControlName must be used with a parent formGroup directive. You'll want to add a formGroup directive and pass it an existing FormGroup instance (you can create one in your class).
How I can get access to form controller from component A?