title: How to wait in Angular 7 until DOM changed ready?
body: <p>I have a list of entries. When I click on such an entry a HTTP request is done, data will be loaded and presented in a table. So far so good.</p>
  
  <p>Now I try to create an export function to output all tables at once. The abstracted code looks like this:</p>
  
  <pre><code>this.objectlist.forEach(entry =&gt; {
  
      this.getDataFromHTTP(entry).subscribe(response =&gt; {
          tabledata.push(this.getTableDOM());
      })
  
  })
  </code></pre>
  
  <p>In the function <code>getTableDOM()</code> I do something like <code>let table = document.getElementsByClassName(data.classname);</code>. The code itself runs when I click every entry. But it doesn't work within the <code>forEach()</code>.</p>
  
  <p>The real problem is that the <code>getTableDOM()</code> returns an empty result, because the DOM isn't ready when it is called. </p>
  
  <p>So my question is: how can I wait until DOM changes are done before I call <code>getTableDOM()</code>. Or maybe my approach to achieve my goal is completely wrong. But if so: how can I do it otherwise?</p>
  
  <p>Thx for your help!
  Lars</p>