How to retrieve data from a table cell in angular 2
<p>I am using Angular 2. I try to retrieve data from a table cell. Is there an Angular 2 way to do this?</p>

<p>I tried to do like this, but I got <code>undefined</code> value.</p>

<pre><code>&lt;table&gt;
    &lt;thead&gt;
    &lt;tr&gt;
        &lt;th&gt;Firstname&lt;/th&gt;
        &lt;th&gt;Lastname&lt;/th&gt;
        &lt;th&gt;Email&lt;/th&gt;
    &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;tr&gt;
        &lt;td (click)="getValue($event)"&gt;John&lt;/td&gt;
        &lt;td&gt;Doe&lt;/td&gt;
        &lt;td&gt;john@example.com&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Mary&lt;/td&gt;
        &lt;td&gt;Moe&lt;/td&gt;
        &lt;td&gt;mary@example.com&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

getValue(event:any) {
    let value = event.target.value;
    console.log("value", value);
}
</code></pre>