I have my reactive form which looks something like this
<form [formGroup]="addInvoiceForm" (submit)="onAddInvoiceFormSubmit()">
<div [formArrayName]="itemRows">
<div *ngFor="let itemrow of addInvoiceForm.controls.itemRows.controls; let i=index" [formGroupName]="i">
<input autocomplete="off" type="text" formControlName="itemqty">
<input autocomplete="off" type="text" formControlName="itemrate">
<!-- the input field below is to be summed -->
<input autocomplete="off" type="text" formControlName="itemamt" [ngModel]="itemrow.get('itemqty').value * itemrow.get('itemrate').value">
</div>
</div>
<button type="button" (click)="addItemRow()">Add New Row</button>
</form>
I want to sum the itemamt of all the rows created by user and pass them into form data. Can someone help me, tell me how to sum all the itemamt fields in the form and show user side by side what's the total amount?