title: If condition in Angular material table
body: <p>I am using Angular material table and I want to hide a column in table on the basis of if-condition. If the condition is true the column shows on the page otherwise it hides.</p>
  <p>this is my html code.</p>
  <pre><code> &lt;ng-container matColumnDef=&quot;delete&quot;&gt;   
    &lt;th class=&quot;th&quot; mat-header-cell  *matHeaderCellDef&gt; Delete &lt;/th&gt;
      &lt;td mat-cell *matCellDef=&quot;let element&quot; &gt;&lt;span&gt;&lt;i class=&quot;fa fa-trash&quot; aria-hidden=&quot;true&quot; (click)=&quot;check(element._id)&quot;  style=&quot;cursor: pointer;&quot;  data-toggle=&quot;modal&quot; data-target=&quot;#dModal&quot;&gt;&lt;/i&gt;&lt;/span&gt; 
       &lt;/td&gt;  
    &lt;/ng-container&gt;
  </code></pre>
  <p>this is my ts code</p>
  <pre><code> displayedColumns: string[] = ['assessment','status','action','issue','created','delete'];
  </code></pre>
  <p>I tried but failed can anyone help me?</p>