We know it is easy to do sorting and pagination in angular(only consider sorting in client end). refer to : https://stackblitz.com/angular/dnblbyvggqyj?file=src%2Fapp%2Ftable-sorting-example.ts. But how to integrate sorting and pagination for several seperate tables(same data structure for these tables).
For my understanding, in order to do this, we need serveral viewChild(the number of viewchild equals to the number of table). Also we need to initialize serveral MatTableDataSource objects. We can put it in a hashmap Like:
{table1Tittle: new MatTableDataSource<Object>(), table2Tittle: new MatTableDataSource<Object>(), ...., };
But the thing is we don't know the number of table before we get the data. How should we decorate the viewchild and let the number of viewchild to be same as the number of table.