this.formgroup = formbuilder.group({
ordering_data: formgroup.array([this.createOrder()]),
});
createOrder(): FormGroup {
return this.fb.group({
order: [null, [Validators.required]],
section_menu_id: [null, [Validators.required]],
});
}
Api Result
[
{
"order": 0,
"section_menu_id": 3
},
{
"order": 1,
"section_menu_id": 1
},
{
"order": 2,
"section_menu_id": 6
},
]
I try to show all those data from api result on my form input. Can someone tell me how to patch the api result into formgroup. Thanks in advance
In my projects, I do something like this :