I\'m trying to trigger an event when scroll bar reaches the end. I found this this example. Here is my code. The problem is that it doesn\'t call loadmore() at all. The values o
When browser's scroll bar reached to down, we need to fire an event. Below code will work for Angular 6.
import { HostListener } from '@angular/core';
@HostListener('window:scroll', ['$event'])
onScroll(): void {
if ((window.innerHeight + window.scrollY) >= (document.documentElement.scrollHeight - 1)) {
// Place your code here
}
}