I'm trying to get the index number of each element add it to the particular row with data. I have used *matCellDef="let element; let i = index"
and it doesn't work well with the mat-paginator.
Expected Result:
component.ts
getNotifications(){
this.notificationService.getNotifications()
.pipe(first())
.subscribe(
data => {
this.notifications = <Notification[]>data;
this.dataSource = new MatTableDataSource();
this.dataSource.data = data;
this.dataSource.paginator = this.paginator;
},
error => {
console.log("An Error Occurred");
});
}