I use Angular 6, Firebase and Angular Material.
I have 30,000 json objects stored in firebase that I want to load them into a mat-table. Only I get way below that I wish. I wait 30 seconds before I can click on my application, sometimes chrome is in error ...
Yet I load my data after pagination.
Can someone tell me if this is normal or if there is a strategy to overcome this problem? Thank you.
Maybe i can do this with angular 7 and infite scrolling ? Do you have an example pleas?
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) sort: MatSort;
ngAfterViewInit() {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
return this.geoService.getGeos().subscribe(res => {
this.dataSource.data =
res;
this.showSpinner = false;
});
}
constructor(public authService: AuthService, private geoService:
GeoService, private router: Router, private database: AngularFireDatabase) {
}
ngOnInit() {}
}