title: How to call a function when element is loaded at Angular?
body: <p>I want to call a function with an argument when an element is loaded.
  Just like nginit in angualrjs. Can we do it in Angular 4 and above?</p>
  <pre class="lang-html prettyprint-override"><code>    &lt;div *ngFor=&quot;let item of questionnaireList&quot;  
         (onload)=&quot;doSomething(item.id)&quot; &gt;
      &lt;/div&gt;
  </code></pre>
  <p>My Typescript function:</p>
  <pre class="lang-js prettyprint-override"><code>    doSomething(id) {
          console.log(id);
      }
  </code></pre>