From 2f161eb7a5ab54a06a58434eceb1fd949663ac53 Mon Sep 17 00:00:00 2001 From: Akshat Patel Date: Sat, 19 Aug 2023 17:44:33 -0400 Subject: [PATCH] fix: Add empty string option for props that match directive name Signed-off-by: Akshat Patel --- src/layer/layer.directive.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/layer/layer.directive.ts b/src/layer/layer.directive.ts index 6a74699c63..0849a03544 100644 --- a/src/layer/layer.directive.ts +++ b/src/layer/layer.directive.ts @@ -23,16 +23,19 @@ export class LayerDirective implements AfterContentInit { /** * @deprecated as of v5 - Use `cdsLayer` input property instead */ - @Input() set ibmLayer(level: 0 | 1 | 2) { + @Input() set ibmLayer(level: 0 | 1 | 2 | "") { this.cdsLayer = level; } /** * Override layer level + * Empty string has been added as an option for Angular 16+ to resolve type errors */ - @Input() set cdsLayer(level: 0 | 1 | 2) { - this._passedLevel = level; - this.layer = level; + @Input() set cdsLayer(level: 0 | 1 | 2 | "") { + if (typeof(level) === "number") { + this._passedLevel = level; + this.layer = level; + } } get cdsLayer() {