When I delete element my MAT-TABLE is not refresh
.ts file
import { MatTableDataSource, MatTable } from '@angular/material/table';
@ViewChild(MatTable) table: MatTable<any>;
const index = this.dataSource.data.findIndex(d => Number(d.id) == Number(id));
this.dataSource.data.splice(index, 1);
this.table.renderRows();
.html file
<table mat-table [dataSource]="dataSource" class="lessons-table mat-elevation-z8" matSort table>
filterand usetriple-equals:this.dataSource.data = this.dataSource.data.filter(item => +item.id !== +id);. Doing that way, you don't need to usefindIndex.