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
I had to make default sort on load
const matSort = { id: defaultSort.name } as MatSortable; this.sort.direction = defaultSort.sort === 'asc' ? '' : defaultSort.sort === 'desc' ? 'asc' : 'desc' as SortDirection; this.sort.sort(matSort);