I need help figuring out how to trigger a function when the scrollbar reaches the bottom of the page.
Is there a way to determine if the scroll has reached the end of the page?
@HostListener("window:scroll", [])
onScroll(): void {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
console.log('end')
}
}
Unfortunately, the current code isn't functioning as expected.
Any suggestions on how to make this work properly?