I have to make a single submit.
But i will show the user 4 forms dynamically
fields: any = [
[
{ label: "firstname", name: "first" },
{ label: "lastname", name: "last" },
{ label: "Date", name: "fromDate", type: "date" },
{ label: "To Date", name: "toDate", type: "date" },
],
[
{ label: "firstname", name: "first" },
{ label: "lastname", name: "last" },
{ label: "age", name: "age"},
{ label: "address", name: "add" },
],
[
{ label: "firstname", name: "first" },
{ label: "lastname", name: "last" },
{ label: "mobile", name: "mob" },
],
]
now using these fields i made my html dynamic with multiple submit button. you may see they have sometimes same form control name, sometimes diff form control name.
name field inside obj, will actually been given to formControlName dynamically.
the problem is:
I have multiple forms in one page
Form 1 with submit button
Form 2 with submit button
Form 3 with submit button
Form 4 with submit button
These from have diffn control name & label but look similar so I made it dynamic
But problem is Formbuilder
How can I make that Dynamic.