Reputation: 125
No I have a form field using angular and I want to replicate whole form each time user clicks in a add button. Each new row form will be a separatly request to the server using RxJS
At the end will be a "run" button, enabled when all form info will be added.
How can I do it? Any example to follow?
Thank you very much
Upvotes: 0
Views: 1202
Reputation: 784
It's simple you just need to create array of FormGrop
like
forms: FormGroup[]
and on add form button click you just need to add new form into that
Here is the example code https://stackblitz.com/edit/angular-multiple-dynamic-form
Example App: https://angular-multiple-dynamic-form.stackblitz.io
Upvotes: 2