Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldArrayType.add() fails when using FormlyFormBuilder.buildForm() #3576

Closed
Marcus-Karl opened this issue Jan 25, 2023 · 1 comment · Fixed by #3677
Closed

FieldArrayType.add() fails when using FormlyFormBuilder.buildForm() #3576

Marcus-Karl opened this issue Jan 25, 2023 · 1 comment · Fixed by #3677
Labels

Comments

@Marcus-Karl
Copy link

Description
After converting a json schema with an array of objects. If you call FormlyFormBuilder.buildForm you cannot call FieldArrayType.add without getting a console error. Form.valid checks for the form will fail and the form controls will also not render on screen.

image

Minimal Reproduction
https://stackblitz.com/edit/ngx-formly-ui-material-aydnff

Your Environment

  • Angular version: 15.1.2
  • Formly version: 6.1.1

Additional context
It looks like FormlyFormBuilder.buildForm() changes the FormArray built in the json schema service to a FormControl, which doesn't have the setControl method.

@aitboudad
Copy link
Member

This issue has been fixed and released as part of v6.1.5 release.

Please let us know, in case you are still encountering a similar issue/problem.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants