title: How to write click event for viewchild element reference in angular 8
body: <p>Tried click event for element reference in typescript but not working.How to write click event for element reference.If anyone know please help to find the solution.</p>
  
  <p>app.component.ts:</p>
  
  <pre class="lang-js prettyprint-override"><code>@ViewChild('testElem') el:ElementRef;
  @ViewChild('testElem2') el2:ElementRef; 
  
  this.el.on('click',()=&gt;{ 
    alert("test"); 
  });
  </code></pre>
  
  <p>app.component.html:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div #el&gt;testElem&lt;/div&gt;
  
  &lt;div #el2&gt;testElem2&lt;/div&gt;
  </code></pre>