Skip to content

Commit

Permalink
fix: Add empty string option for props that match directive name
Browse files Browse the repository at this point in the history
Signed-off-by: Akshat Patel <[email protected]>
  • Loading branch information
Akshat55 committed Aug 19, 2023
1 parent 4dcb72f commit 2f161eb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/layer/layer.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2f161eb

Please sign in to comment.