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

Regarding the FormArray #4

Open
ghost opened this issue Jan 13, 2022 · 0 comments
Open

Regarding the FormArray #4

ghost opened this issue Jan 13, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 13, 2022

Hello, I have been trying to create FormArray with this library. but i am unclear how it handles array

while generating form -- does it create FormArray or FormGroup if an array is present in json?

What I tried?
https://www.hiteshbalar.com/ngx-recursive-form/

{
                "order": 3,
                "name": "language",
                "label": "Languages you know",
                "type": "array",
                "parameters": [
                    {
                        "name": "languageName",
                        "label": "Language Name",
                        "type": "string",
                        "placeholder": "Input language name"
                    },
                    {
                        "name": "experience",
                        "label": "Total Experience",
                        "type": "number",
                        "placeholder": "Total experience in year"
                    }
                ],
                "defaultValue": [
                    {
                        "languageName": "JavaScript",
                        "experience": 4
                    },
                    {
                        "languageName": "has",
                        "experience": 3
                    },
                    {
                        "languageName": "not",
                        "experience": 2
                    }
                ]
            }

This works.
But I do this in my componet files is returned as FormGroup. Instead it should be FormArray.

Please clarify.

@ghost ghost changed the title Regarding the array Regarding the FormArray Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants