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 don't know if the ChangeDetectorRef was required when the question was created, but now this is enough:
import { MatTableDataSource } from '@angular/material/table';
// ...
dataSource = new MatTableDataSource();
refresh() {
this.myService.doSomething().subscribe((data: MyDataType[]) => {
this.dataSource.data = data;
}
}
Example:
StackBlitz