Reputation: 764
I'm trying to bind to clientWidth
element property, but it errors that clientWidth
is not property of the element I'm targeting.
Can you bind to any element property? and does it matter if it is read only?
Is this:
<div [style.width.px]="width">
As valid as this:
<div [clientWidth]="width">
Upvotes: 0
Views: 220
Reputation: 657038
https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth
intElemClientWidth is an integer corresponding to the clientWidth of element in pixels. clientWidth is read–only.
You can do data binding with any property that is not read-only and to every input of an Angular component (and directives).
You can do event binding with every DOM event (also custom DOM events) and every output of Angular components (and directives)
Upvotes: 3