I have an Angular Material Table with sorting:
table.component.html
:
<table mat-table [dataSource]="dataSource" matSort>
<th mat-header-cell mat-sort-header *matHeaderCellDef>
<span>Name</span>
</th>
...
</table>
This displays a sort button in the header cell in the usual Material style.
I need to change the style (not the functionality) of the sort button. How can I do that? I tried creating my own button, but I do not know how to access the Material sort button's functionality.
table.component.html
:
<table mat-table [dataSource]="dataSource" matSort>
<th mat-header-cell *matHeaderCellDef>
<span>Name</span>
<!-- `style` contains some custom styling -->
<!-- `(click)` should do the same as on the Material sort button -->
<button mat-button mat-icon-button (click)=??? style=...>
<mat-icon>sort</mat-icon>
</button>
</th>
...
</table>