this.InvoiceForm=this.fb.group({
InvoiceNumber:[''],
EntryDate:[''],
InvoiceItem:this.fb.array([this.AddItemFormGroup()])
})
AddItemFormGroup()
{
return this.fb.group({
ItemName:[''],
ItemType:['']
})
Save()
{
console.log(this.InvoiceForm.value);
console.log(this.InvoiceForm.InvoiceItem[0].ItemName);
}
when I log the values it shows but when I log the value of specific row of nested form array it give error: ERROR TypeError: Cannot read properties of undefined (reading 'ItemName')