Mat-Table Working Perfect. Is there a way to add an auto increment Index. My Html for the 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>
<ng-container matColumnDef="Title">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Title </th>
<td mat-cell *matCellDef="let element"> <a (click)="openDescriptionView(element.title, element.imageUrl, element.description)">{{element.title}}</a>
</td>
</ng-container>
<ng-container matColumnDef="destination">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Destination </th>
<td mat-cell *matCellDef="let element"> {{element.destination}} </td>
</ng-container>
<ng-container matColumnDef="startDate">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Start Date </th>
<td mat-cell *matCellDef="let element"> {{element.startDate}}</td>
</ng-container>
<ng-container matColumnDef="endDate">
<th mat-header-cell *matHeaderCellDef mat-sort-header> End Date </th>
<td mat-cell *matCellDef="let element">{{element.endDate}}</td>
</ng-container>
<ng-container matColumnDef="price">
<th mat-header-cell *matHeaderCellDef mat-sort-header> price </th>
<td mat-cell *matCellDef="let element">{{element.price}}</td>
</ng-container>
<ng-container matColumnDef="setting">
<th mat-header-cell *matHeaderCellDef> Settings </th>
<td mat-cell *matCellDef="let element">
<a class="myIcon" (click)="editOffer(element.id)"><i class="pe-7s-pen"></i></a>
<a class="myIcon" (click)="deleteOffer(element.id, element.title)"><i class="pe-7s-trash"></i></a>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [pageSizeOptions]="[10, 20]" showFirstLastButtons></mat-paginator>
I go to the next page it starts again from one. If I am showing 10 item per page then after goes to next page it starts with one instead of eleven. I also tried let i=dataIndex and that shows 'NaN'. Please help.