If you’re currently working with Angular 4, chances are you’re using ngx-datatable somewhere in your app.
It is also very likely that automatic sorting will not work. To remedy it I looked a little on my side and I came across these two resources:
Basically, you’ll need to add the following two attributes to your code:
<ngx-datatable-column [sortable]="true" [prop]="yourColumnName"></ngx-datatable-column>
Note that prop represents the prop attribute in your model object that you assign to the data table. If you haven’t defined it, ngx-datatable adapts it to the camelCase format as documented here.
Be sure to let me know if I made a mistake in the article or if you have any suggestion, correction or question!