I want to execute a function when the scrollbar reaches the bottom of the page.
How do I know 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')
}
}
but it not work .
How can i do this work ????