Question

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)?

Was it helpful?

Solution

In Polymer you can use the following construction:

<input type="checkbox" checked="{{isChecked}}"/> Check me to enable textbox
 <input type="text" disabled?="{{!isChecked}}"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top