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?
Well, this is not well documented in the Angular doc, you can find under source code of Angular at -
https://github.com/angular/angular/blob/master/packages/common/src/directives/ng_for_of.ts
*ngFor accepts count params.
So we can get the count like -
Another solution could be the following
Plunker Example
See also
See also https://angular.io/api/common/NgForOf