我使用 Angular 6、Firebase 和 Angular Material。
我有 30,000 个 json 对象存储在 firebase 中,我想将它们加载到 mat-table 中。只有我得到的远低于我希望的。我等了 30 秒才可以点击我的应用程序,有时 chrome 会出错......
但是我在分页后加载我的数据。
有人可以告诉我这是否正常,或者是否有解决此问题的策略?谢谢你。
也许我可以用 angular 7 和无限滚动来做到这一点?你有一个例子请求吗?
export class TableComponent implements OnInit {
showSpinner = true;
Data = {nom: '', finessgeo: '', cat1: '', commune: '', CP: '', departement: '', tel: ''}
displayedColumns = ['nom', 'finessgeo', 'cat1', 'commune', 'CP', 'departement', 'tel'];
dataSource = new MatTableDataSource();
applyFilter(filterValue: string) {
filterValue = filterValue.trim();
filterValue = filterValue.toLowerCase();
this.dataSource.filter = filterValue;
}
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) …Run Code Online (Sandbox Code Playgroud)