Reputation: 17642
According to Ember's website:
If you use
{{bind-attr}}
with a Boolean value, it will add or remove the specified attribute. For example, given this template:
Let's say I have some property isReadOnly
on a controller. This works nicely:
<input type="text" {{bind-attr disabled=isReadOnly}}>
//disabled only when isReadOnly is true
But input helpers don't have this behavior for boolean values, which is inconvenient for the disabled attribute:
{{input type="text" disabled=isReadOnly}}
//disabled when isReadOnly is not null
I'd like to be able to set isReadOnly to false and have the box disabled. How to combine this ability with benefits of input helpers?
Thanks (:
Upvotes: 0
Views: 318