I want to dynamically add mat-icon via innerHtml to my component but the result is icon text not icon shape.
here is my template variable:
edit_template = `
<button mat-icon-button color="primary" (click)="clicked()">
<mat-icon aria-label="Edit data">edit</mat-icon>
</button>
`;
and here is innerHtml:
<table mat-table [dataSource]="this.dataSource">
<div *ngFor="let displayedColumn of displayedColumns">
<ng-container [matColumnDef]="displayedColumn">
<th mat-header-cell *matHeaderCellDef> {{displayedColumn}} </th>
<td mat-cell *matCellDef="let element" [innerHTML]="element[displayedColumn]"></td>
</ng-container>
</div>
</table>
And the result is edit
word instead of edit icon!
in addition to mentioned problem, even edit
word doesn't act as button but just as a text!
What's your idea?