Sorting an Angular Material table – how to use MatSort and sortingDataAccessors

Emmy Hermans

Angular Material provides the MatSort directive as an easy way the include interactive sorting in the tables of your application. In this blogpost I will show the best way to add sorting to your Material table. In addition, I will show how to use custom sortingDataAccessors to sort on nested properties and case insensitively, and how to combine different sorting requirements.