title: How to check that scroll is end of bottom in Angular 4?
body: <pre><code>  @HostListener('window:scroll', ['$event'])
    onWindowScroll() {
      if ((window.innerHeight + window.scrollY) &gt;= document.body.offsetHeight) {
          console.log('reached bottom');
      }
    }
  </code></pre>
  
  <p>It is working of this code as above, but it occured many times even not reached exactly end of bottom.</p>
  
  <p>How to check wheather scroll is reached to end of bottom?</p>