To update the table you can call renderRows()
on Angular Material Table.
import ViewChild
and MatTable
:
import {Component, ViewChild} from '@angular/core';
import {MatTable} from '@angular/material';
Then you can get a reference to the table using the ViewChild
@ViewChild(MatTable) table: MatTable<any>;
Then when you modify the table in any way you will need to call the renderRows() method.
updateTable(row: any): void {
/* update logic here */
this.table.renderRows();
}
Check this example: https://stackblitz.com/edit/angular-bxrahf