title: Angular 4 Execute Function when html fully loaded
body: <p>I have a problem with asynchronous HTTP calls in Angular 4 using typescript/components... I create an array of objects, and in the HTML I have checkboxes next to the objects. Now I want certain objects to be checked, by executing a function in angular. However when I do </p>
  
  <pre><code> (document.getElementById(id) as HTMLInputElement).checked = true;
  </code></pre>
  
  <p>In my component.ts.
  It can't find the element however when I do the same code in a function that executes when you push a button it works. So the problem is that the HTML is not fully loaded when I execute the function. How can I make sure the HTML is fully loaded? </p>