I am using a mat-table to list the content of the users chosen languages. They can also add new languages using dialog panel. After they added a language and returned back.
I think the MatTableDataSource object is some way linked with the data array that you pass to MatTableDataSource constructor.
For instance:
dataTable: string[];
tableDS: MatTableDataSource;
ngOnInit(){
// here your pass dataTable to the dataSource
this.tableDS = new MatTableDataSource(this.dataTable);
}
So, when you have to change data; change on the original list dataTable and then reflect the change on the table by call _updateChangeSubscription() method on tableDS.
For instance:
this.dataTable.push('testing');
this.tableDS._updateChangeSubscription();
That's work with me through Angular 6.