I am facing this issue if i am adding ngx-paginator to mat table. Please help me out.
<table mat-table [dataSource]="dataSource| paginate: {itemsPerPage: size, currentPage: p,
totalItems: EMP_DATA.length}" class="mat-elevation-z8" matSort>
.
.
<pagination-controls (pageChange)="p = $event;paginate(p)"
[responsive]="true"
></pagination-controls>
IN ts file
size = 10;
pageIndex = 0;
p=1;
dataSource = new MatTableDataSource<EmpElement>(this.EMP_DATA);
paginate(event: any) {
this.pageIndex=event;
}
From the error, I am assuming that EmpElement is not an array
Change below line :