I have a component (in sample named: Hello) that has a FormGroup. The controls of the FormGroup have to be defined outside the component using ng-content.
A Simple sample in stackblitz: https://stackblitz.com/edit/angular-ivy-bqczmm?file=src%2Fapp%2Fhello.component.ts
Hello Component:
<form [formGroup]="fg">
<ng-content select="[fg-controls]"></ng-content>
<pre>{{fg.value | json}}</pre>
</form>
Parent Component:
<hello>
<div fg-controls>
<h1>Item 1</h1>
aaa: <input formControlName="aaa" /><br /><br />
bbb: <input formControlName="bbb" /><br /><br />
ccc: <input formControlName="ccc" />
</div>
</hello>
<hello>
<div fg-controls>
<h1>Item 2</h1>
aaa: <input formControlName="aaa" /><br /><br />
bbb: <input formControlName="bbb" /><br /><br />
</div>
</hello>
I've got this error:
I know the variables are defined outside the FormGroup but in runtime in DOM its OK:

Is there a right way to do it?
