dposada
dposada

Reputation: 899

Is there a Polymer equivalent to Angular's "ng-disabled"

Is there a way in Polymer to disable an element based on a condition using a construct like Angular's ng-disabled?

For example, in Angular, I can say:

Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
<button ng-model="button" ng-disabled="checked">Button</button>

And the button will automatically enable/disable based on whether or not the checkbox is checked.

Is there a similar way to accomplish this in Polymer (without Angular)?

Upvotes: 2

Views: 473

Answers (1)

Sergey Lazutkin
Sergey Lazutkin

Reputation: 121

In Polymer you can use the following construction:

<input type="checkbox" checked="{{isChecked}}"/> Check me to enable textbox
 <input type="text" disabled?="{{!isChecked}}"/>

Upvotes: 3

Related Questions