Skip to content

Commit

Permalink
Merge pull request #2679 from Akshat55/layer-fix
Browse files Browse the repository at this point in the history
fix: Add empty string option for props that match directive name
  • Loading branch information
Akshat55 authored Aug 22, 2023
2 parents 4dcb72f + 2f161eb commit 239f025
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 239f025

Please sign in to comment.