I have an Angular loop that has a conditional check in it. Thus, the usual answer of using the .length on the array, or using the i from index won't tell me how many items are showing.
<form [formGroup]="paymentsForm">
<div formArrayName="arrVoucherLines">
<div *ngFor="let line of paymentsForm.get('arrVoucherLines')['controls']; index as i"
[formGroupName]="i">
<div *ngIf="dateCheckingConditionalFunctionPlaceholder()">
<mat-checkbox formControlName='FlagPayInvoice'></mat-checkbox>
Issued: {{line.value.DateTimeLocalInvoiceIssued |date:'MM/dd'}}
Due: {{line.value.DateTimeLocalInvoiceDue |date:'MM/dd'}}
... variety of other voucer info
</div>
</div>
</div>
</form>
Displaying the total amount of items is easy, but I want to also be able to display how many are shown and how many were skipped. If I could have a "variable++" in the loop that would be pretty easy.
Desired result would be to end up with something that I could:
Total invoices {{blah.length}}
Invoices Shown {{count}}
Invoices not yet due: {{blah.length-count}}
The usage case is the user is selecting a cutoff date on the form, and only showing the bills due before that date.