From e67a6006b358fcba00d7be9f77a0f6a415728aac Mon Sep 17 00:00:00 2001 From: "malin.klingsell@allianz.de" Date: Tue, 15 Oct 2024 11:36:40 +0200 Subject: [PATCH] fix(table): change sorting direction (#1359) --- .../examples/table/table-sorting/table-sorting-example.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/ng-aquila/documentation/examples/table/table-sorting/table-sorting-example.ts b/projects/ng-aquila/documentation/examples/table/table-sorting/table-sorting-example.ts index 9b9b6aff4..193ca03e5 100644 --- a/projects/ng-aquila/documentation/examples/table/table-sorting/table-sorting-example.ts +++ b/projects/ng-aquila/documentation/examples/table/table-sorting/table-sorting-example.ts @@ -108,6 +108,11 @@ export class TableSortingExampleComponent { b: number | string | Date, direction: SortDirection, ) { - return (a < b ? -1 : 1) * (direction === 'asc' ? 1 : -1); + if (a < b) { + return direction === 'asc' ? -1 : 1; + } else if (a > b) { + return direction === 'asc' ? 1 : -1; + } + return 0; } }