How can I change Angular Material code below, so that data-table is sorted by \'name\' column, ascending order by default. Arrow (indicating current sort direction) must be
In my case sorting was not working because matColumDef id and mat-cell var is different
First Name {{ item.name}}
after making changes matColumnDef="firstName" to matColumnDef="name" which is same as item.name
it works fine for me