I'm implementing the sortModule for angular material mat-table but for some reason it works perfectly for all the columns expect one. When I try to sort with it returns the table to it's initial situation but it does not sort.
html code for the mat-table:
<mat-table [dataSource]="demandesData" matSort matSortActive="dateCreation" matSortDirection="desc" >
columns that work:
<ng-container matColumnDef="typeDemande" >
<mat-header-cell *matHeaderCellDef mat-sort-header >
Type demande
</mat-header-cell>
<mat-cell *matCellDef="let element">
{{ element.typeDemande }}
</mat-cell>
</ng-container>
<ng-container matColumnDef="dateCreation">
<mat-header-cell *matHeaderCellDef mat-sort-header> date création </mat-header-cell>
<mat-cell *matCellDef="let element">
{{ convertDate(element.dateCreation) }}
</mat-cell>
</ng-container>
the sorting is not working on this column:
<ng-container matColumnDef="nom">
<mat-header-cell *matHeaderCellDef mat-sort-header> Nom du collaborateur</mat-header-cell>
<mat-cell *matCellDef="let element">
{{ element.user_ajout.nom }}
</mat-cell>
</ng-container>