title: How to get row data using angular material?
body: <p>I have angular4 with materialize table Api so I am trying to get row data when user click on the row but its not passing data, How can i pass data to component from view any help will be appreciated ?</p>
  
  <p>app.component.html</p>
  
  <pre><code>&lt;div class="table-container"&gt;
  &lt;mat-table&gt;
         &lt;ng-container matColumnDef="eventType"&gt;
              &lt;mat-header-cell *matHeaderCellDef&gt; Event Type &lt;/mat-header-cell&gt;
              &lt;mat-cell *matCellDef="let element"&gt; {{element.eventType}} &lt;/mat-cell&gt;
            &lt;/ng-container&gt;
            &lt;!--&lt;button (click)="newMessage()" class="button"&gt;New Message&lt;/button&gt;--&gt;
            &lt;mat-header-row *matHeaderRowDef="displayedColumns"&gt;&lt;/mat-header-row&gt;
            &lt;mat-row *matRowDef="let row; columns: displayedColumns;" (click)="highlight(row._id,$event)"&gt;&lt;/mat-row&gt;
          &lt;/mat-table&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>app.component.ts</p>
  
  <pre><code>highlight(id,event){
          console.log('Event',event);
      }
  </code></pre>