You could check whether the user has scrolled to the bottom or not in the below way...
Html file
<div (scroll)="onScroll($event)">
...
...
</div>
typescript file
import { Component, HostListener } from '@angular/core';
...
...
@HostListener('scroll', ['$event'])
onScroll(event: any) {
// visible height + pixel scrolled >= total height
if (event.target.offsetHeight + event.target.scrollTop >= event.target.scrollHeight) {
console.log("End");
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…