title: How to write click event for dynamic generated table's first td value in angular 6
body: <p>I tried to write click event for table's tr td's value.I have generated one table and I have tableid.I want to show alert if I click first column td values.How we can do it?Any solution is there?</p>
  
  <p>Please do not write any inline onclick events.i want to write inside <code>app.component.ts</code> file.</p>
  
  <p>Example:</p>
  
  <p><code>app.component.html</code>:</p>
  
  <pre><code>&lt;custom-table id="tableId"&gt;
       &lt;table&gt;
        &lt;thead&gt;
          &lt;th&gt;Company&lt;/th&gt;
          &lt;th&gt;Contact&lt;/th&gt;
          &lt;th&gt;Country&lt;/th&gt;
        &lt;/thead&gt;
        &lt;tr&gt;
          &lt;td&gt;123456&lt;/td&gt; ----&gt;If i click this i want to show alert with this value
          &lt;td&gt;Maria Anders&lt;/td&gt;
          &lt;td&gt;Germany&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;253689&lt;/td&gt;----&gt;If i click this i want to show alert with this value
          &lt;td
          &lt;td&gt;Francisco Chang&lt;/td&gt;
          &lt;td&gt;Mexico&lt;/td&gt;
        &lt;/tr&gt; 
       &lt;/table&gt;
  &lt;custom-table&gt;
  </code></pre>
  
  <p><code>app.component.ts</code>:</p>
  
  <pre><code>ngOnInit(){
  
  ???
  }
  </code></pre>