title: angular - scroll height and document height units
body: <p>When the window slides, it can detect the current height, but I don't know the unit of this height. I hope to get the total height(bottom height) by angular.</p>
  
  <p>The height of the <code>document</code> is different from the height unit of the <code>scroll</code>. How do you convert between the two? Or in what way do you get the common unit?</p>
  
  <p>For example:</p>
  
  <pre><code> import {HostListener,Inject} from "@angular/core";
   import { DOCUMENT } from "@angular/platform-browser";
  
   constructor(@Inject(DOCUMENT) private document: Document {}
  
   ngOnInit() {
   }
  
   @HostListener("window:scroll", [])onWindowScroll() {
      //.scrollTop
      console.log(this.document.documentElement.scrollTop)
      //.clientHeight
      console.log(this.document.documentElement.clientHeight);
      //.innerHeight
      console.log(window.innerHeight);
   }
  </code></pre>
  
  <p>These three are different.
  <code>document.documentElement.scrollTop</code> ≠ <code>document.documentElement.clientHeight</code> ≠ <code>window.innerHeight</code></p>