you have the option to include something similar
<table>
<cdk-virtual-scroll-viewport #scroller itemSize="6" class="content">
<ng-container *cdkVirtualFor="let item of items; let i = index">
<thead *ngIf="!i">
<tr>
<td>Property1</td>
<td>Property2</td>
</tr>
</thead>
<tr>
<td style="min-width:10rem">
{{ item.property1 }}
</td>
<td style="min-width:10rem">{{ item.property2 }}</td>
</tr>
</ng-container>
</cdk-virtual-scroll-viewport>
</table>
Utilizing a standard cdkscroll
ngOnInit()
{
this.fetchData();
this.scroller.elementScrolled().pipe(
map(() => this.scroller.measureScrollOffset('bottom')),
pairwise(),
filter(([y1, y2]) => (y2 < y1 && y2 < 140)),
throttleTime(200)
).subscribe(() => {
this.ngZone.run(() => {
this.fetchData();
})
}
);
}
fetchData(): void {
const additionalItems="......."
this.items=[...this.items,...additionalItems]
}
Check out this stackblitz example