0
Hi Ramco,
try this changes and also Dom Side some changes
export class LayoutComponent implements OnInit {
displayedColumns: string[] = ['id', 'empName', 'empContactNo', 'empEmail','action'];
dataSource!: MatTableDataSource<any>;
@ViewChild(MatPaginator) paginator!: MatPaginator;
@ViewChild(MatSort) sort!: MatSort;
constructor(private _dialog:MatDialog){}
openAddEditForm(){
this._dialog.open(EmpAddEditComponent)
}
ngOnInit(): void {
this.getallEmployee();
}
getallEmployee() {
this.----.get('onlinetestapi.gerasim.in/api/TeamSync/GetAllEmployee').subscribe((result: any)=>{
this.dataSource = new MatTableDataSource(result.data);
debugger;
// this.dataSource.sort = this.sort;
// this.dataSource.paginator = this.paginator;
})
}
applyFilter(event: Event) {
const filterValue = (event.target as HTMLInputElement).value;
this.dataSource.filter = filterValue.trim().toLowerCase();
if (this.dataSource.paginator) {
this.dataSource.paginator.firstPage();
}
}
}