here is my loop:
<div *ngFor='let item of items; let rowcount = index'></div>
<div>showing {{ rowcount }} of {{ items.length }}
But rowcount is showing NOTHING. Any suggestion on how I can get the value of rowcount correctly?
答案 0 :(得分:3)
Maybe something like this, just need to display it after the last item.
<div *ngFor='let item of items; let rowcount = index'>
<!-- Do all your stuff here -->
<div *ngIf="last">showing {{ rowcount }} of {{ items.length }}</div>
</div>