title: How to get DOM element height?
body: <pre><code>&lt;div style=&quot;width:100%;height:100%;position:relative;background-color:white&quot; id =&quot;OuterSvg&quot;&gt; &lt;/div&gt;
  
  onPageLoaded(){
       console.log(document.getElementById(&quot;OuterSvg&quot;).offsetHeight); //get 0.
  }   
  
  ngAfterViewInit(){
       console.log(document.getElementById(&quot;OuterSvg&quot;).offsetHeight); //get 0.
  }
  </code></pre>
  <p>I have also tried <code>onPageLoaded()</code> and <code>ngAfterViewInit()</code>, but they do not work.</p>
  <p>How to get the element's height/width after it is rendered?</p>