My array sorting function works perfectly until it encounters special characters like Á
or Ű
. Is there a specific TypeScript or Angular 2 method that can help me solve this issue?
Here is an example of the sorting method I am currently using:
private someSortingMethod(): void {
this.sortable= this.sortable.sort((t1: SomeThing, t2: SomeThing): number => {
if (t1.group < t2.group) return -1;
if (t1.group > t2.group) return 1;
if (t1.identifier < t2.identifier) return -1;
if (t1.identifier > t2.identifier) return 1;
return 0;
});
}
Any advice on how to handle special characters in my array would be greatly appreciated. Thank you.