I have the following template:
<div *ngFor="let item of myArray | customPipe1 | customPipe2; let l = length">
Here is the length of my ngFor : {{l}}
</div>
Unfortunately length doesn't exist in ngFor. How can I work around this issue to have the length available inside my ngFor?
Another solution could be the following
<div *ngFor="let item of myArray | customPipe1 | customPipe2; let l = count">
Here is the length of my ngFor : {{l}}
</div>
Plunker Example
See also
<div *ngFor="let item of myArray | customPipe1 | customPipe2 as result">
Here is the length of my ngFor : {{result.length}}
</div>
See also https://angular.io/api/common/NgForOf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With