'How to sort on angular-datatables 13.0.1 headers

Our Angular application has recently upgraded from Angular2 to Angular 13, with this change I have to use angular-datatables 13.0.1 instead of angular-datatables 0.6.0. The code for sort on the headers was working with mfDefaultSorter on angular-datatables 0.6.0 code but fails when I used angular-datatables 13.0.1. what should be the replacement for mfDefaultSorter. I haven't find any examples with sorting on angular-datatables 13.0.1. Is there an example on how to sort angular-datatables 13.0.1 on their headers. Below is the sample code:

<table class="table table-striped table-condensed h5" 
            [mfData]="dataList"  [mfRowsOnPage]="50">
            <thead>
                <tr>
                    <th scope="col" class="text-left">
                        <mfDefaultSorter by="userid">User</mfDefaultSorter>
                    </th>

                    <th scope="col" class="text-left">
                        <mfDefaultSorter by="time">Time</mfDefaultSorter>
                    </th> 
            </thead>
            <tbody>             
                <tr *ngFor="let record of dataList">
                    <th class="text-left">{{record.userid}}</th>
                    <td class="text-left">{{record.time}}</td>
            </tbody>
</table>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source