3

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.