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

有帮助吗?

解决方案

In Polymer you can use the following construction:

<input type="checkbox" checked="{{isChecked}}"/> Check me to enable textbox
 <input type="text" disabled?="{{!isChecked}}"/>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top