From 24ed50a48fd8b67c18b98adc7f6771ce243a54a0 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Mon, 9 Sep 2024 18:38:04 +0200 Subject: [PATCH] Fix for undefined Errors --- bizmatch/src/app/components/header/header.component.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bizmatch/src/app/components/header/header.component.html b/bizmatch/src/app/components/header/header.component.html index cbff6ff..0efc192 100644 --- a/bizmatch/src/app/components/header/header.component.html +++ b/bizmatch/src/app/components/header/header.component.html @@ -22,9 +22,9 @@ id="sortDropdownButton" class="max-sm:hidden px-4 py-2 text-sm font-medium bg-white border border-gray-200 rounded-lg hover:bg-gray-100 hover:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700" (click)="toggleSortDropdown()" - [ngClass]="{ 'text-blue-500': selectOptions.getSortByOption(criteria.sortBy) !== 'Sort', 'text-gray-900': selectOptions.getSortByOption(criteria.sortBy) === 'Sort' }" + [ngClass]="{ 'text-blue-500': selectOptions.getSortByOption(criteria?.sortBy) !== 'Sort', 'text-gray-900': selectOptions.getSortByOption(criteria?.sortBy) === 'Sort' }" > - {{ selectOptions.getSortByOption(criteria.sortBy) }} + {{ selectOptions.getSortByOption(criteria?.sortBy) }} @@ -233,9 +233,9 @@ type="button" id="sortDropdownMobileButton" class="mx-4 w-1/2 px-4 py-2 text-sm font-medium bg-white border border-gray-200 rounded-lg hover:bg-gray-100 hover:text-blue-700 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700" - [ngClass]="{ 'text-blue-500': selectOptions.getSortByOption(criteria.sortBy) !== 'Sort', 'text-gray-900': selectOptions.getSortByOption(criteria.sortBy) === 'Sort' }" + [ngClass]="{ 'text-blue-500': selectOptions.getSortByOption(criteria?.sortBy) !== 'Sort', 'text-gray-900': selectOptions.getSortByOption(criteria?.sortBy) === 'Sort' }" > - {{ selectOptions.getSortByOption(criteria.sortBy) }} + {{ selectOptions.getSortByOption(criteria?.sortBy) }} }