Buzzware
Buzzware

Reputation: 270

Why is bindAttr not working with disabled? Is this a bug?

I am trying to bind the disabled state of a Bootstrap button to a property like this:

<a class="btn btn-large" href="#" {{bindAttr disabled="isDisabled"}} >. . .</a>

In the following Fiddle, the initial state of disabled on the button is correctly set to the initial value of isDisabled (try changing it). Clicking the checkbox changes the value of isDisabled, and the p tag is correctly bound to display it, but the button refuses to respond. Is this a bug?

Please see this fiddle

Upvotes: 3

Views: 938

Answers (1)

Panagiotis Panagi
Panagiotis Panagi

Reputation: 10087

The <a> tag doesn't have a disabled property (check here). This works:

<button class="btn btn-large" 
        {{bindAttr disabled="isDisabled"}}>. . .</button>

See fiddle.

Upvotes: 6

Related Questions