Попробуйте что-то вроде этого:
<ng-container matColumnDef="country" >
<mat-header-cell *matHeaderCellDef (click)="getDataForSort()">
<span *ngIf="sortAsc">
↑
</span>
<span *ngIf="!sortAsc">
↓
</span>
Country
</mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.country}} </mat-cell>
</ng-container>
public sortAsc = true;
...
getDataForSort() {
// filp asc and desc
this.sortAsc = !this.sortAsc;
const dataSource$: any;
if (this.sortAsc) {
dataSource$ = this.country.sortCountryAsc();
} else {
dataSource$ = this.country.sortCountryDesc();
}
dataSource$.subscribe(data => {
this.allCountry = data;
this.CountryDataSource.data = this.allCountry;
});
}