Reputation: 201
I'm tyinng to build a form using multiple reusable sections. I'm using a json object to keep the form data. Form is building without an error. I am using angular reactive forms. So I can't add formArrayName name. it when I add it showing error. Is it must formAraryName? Because without it when I select a dropdown and load another select dropdown data base on first one, the first time it loads correctly. But when I push another group to the array and select an option in first dropdown it change all second dropdown values. How can I load data without changing previeous ones.
Form looks like
code
ui examples
1st time
2nd time
Upvotes: 0
Views: 246
Reputation: 51
I think this repository here can help you.
https://github.com/indrajeetgajbhiye/reactiveFormsDemo
Dynamic formArray implementation upto 3 layers. You can extend it as per your wish.
Upvotes: 1