2

I have "FormWrapper" Component like that

<form [formGroup]="wrapperForm">
  <ng-content></ng-content>
</form>

and AppComponent like that:

<app-form-wrapper>
  <input type="text" formControlName="name" />
  <div formGroupName="userInfo">
    <input type="text" formControlName="email" />
    <input type="text" formControlName="address" />
  </div>
</app-form-wrapper>

But I got this error: Error preview

I tried this solution: Q: How to use Angular 2 template form with ng-content?

but it doesn't work with nested form groups

Beshoy Fayez
  • 29
  • 2
  • 2

0 Answers0