My Mat-Table is working perfectly, but I am looking for a way to add an auto-increment index. Below is the HTML code:
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="no">
<th mat-header-cell *matHeaderCellDef> No </th>
<td mat-cell *matCellDef="let element; let i = index;"> {{i+1}} </td>
</ng-container>
(rest of the HTML code remains the same)
When I go to the next page, the index starts again from one instead of continuing incrementally. Even when showing 10 items per page and moving to the next, it starts over at one instead of eleven. I also tried using 'let i=dataIndex' but that resulted in 'NaN'. Any help on how to achieve this would be appreciated.