I have an array of objects that contain a quantity field. I'm looking to total one field from the array on a review screen on a table.
I have an array of administrations populated with object fields and the one I'm looking to calculate is the 'quantity field'.
<tr class="primary" *ngFor="let medication of sachets">
<td>{{medication.administration.quantity}}</td>
<td>
{{medication.medicationName}}
<p class="instructions">{{medication.additionalInstructions}}</p>
</td>
</tr>
Within the table, I am calculating the length of entries using angulars .length
I'm looking to calculate a total for the array of quantities.