ngneat / forms-manager

🦄 The Foundation for Proper Form Management in Angular
https://www.netbasal.com
MIT License
518 stars 29 forks source link

FormArray with FormGroups inside #25

Open Langstra opened 3 years ago

Langstra commented 3 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

this.formsManager
      .upsert('skills', this.skills, { arrControlFactory: value => new FormGroup(value) })
);
ERROR TypeError: control.setParent is not a function
    at forms.js:4112
    at forms.js:4106
    at Array.forEach (<anonymous>)
    at FormGroup._forEachChild (forms.js:4101)
    at FormGroup._setUpControls (forms.js:4111)
    at new FormGroup (forms.js:3833)
    at arrControlFactory (ubo-form.component.ts:23)
    at ngneat-forms-manager.js:393
    at Array.forEach (<anonymous>)
    at handleFormArray (ngneat-forms-manager.js:388)

Expected behavior

That I can track an array of FormGroup's.

What is the motivation / use case for changing the behavior?

Have the ability to add an array of skills, where a skill is a name + proficiency.