diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index c02c35d4..88e90592 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -343,7 +343,7 @@ export class InputComponent implements OnInit, OnDestroy, OnChanges { } getLabel(value: any) { - let option = this.options.find(option => option.value === value); + let option = this.options.find(option => HelperFunctions.equals(option.value, value)); return (option) ? option.label : value; } diff --git a/utils/HelperFunctions.class.ts b/utils/HelperFunctions.class.ts index d4b34769..81725d14 100644 --- a/utils/HelperFunctions.class.ts +++ b/utils/HelperFunctions.class.ts @@ -57,6 +57,10 @@ export class HelperFunctions { } throw new Error("Unable to copy obj! Its type isn't supported."); } + + public static equals(object1, object2) { + return object1 === object2 || JSON.stringify(object1) === JSON.stringify(object2); + } public static encodeArray(elements: string[]): string[] { let encoded: string[] = [];