Skip to content

Commit f8647c0

Browse files
committed
fix(appHtmlAttr): cannot remove html attribute
usage: - `attributes: {hidden: null}` removes attribute `hidden`
1 parent 46e424d commit f8647c0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

projects/coreui/angular/src/lib/shared/layout/layout.directive.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ export class HtmlAttributesDirective implements OnInit {
169169
}
170170

171171
private setAttrib(key, value) {
172-
this.renderer.setAttribute(this.el.nativeElement, key, value );
172+
value !== null ?
173+
this.renderer.setAttribute(this.el.nativeElement, key, value ) :
174+
this.renderer.removeAttribute(this.el.nativeElement, key);
173175
}
174176
}

0 commit comments

Comments
 (0)