Question
How do I bind a variable to/as the
disabled
attribute of a<paper-checkbox>
element?
Based on the results of my code, it looks like the only way to toggle the disabled
property is to include the disabled
attribute as a string in the start tag. Surely there must be a way to toggle that as a variable?
Link to JSBin
http://jsbin.com/zecidojizu/edit?html,output<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Polymer Bin</title>
<base href="http://element-party.xyz/">
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="all-elements.html">
</head>
<body>
<x-element></x-element>
<dom-module id="x-element">
<template>
<style>
paper-checkbox {
display: block;
margin-bottom: 30px;
}
</style>
<paper-checkbox >A</paper-checkbox>
<paper-checkbox disabled >B</paper-checkbox>
<paper-checkbox xdisabled >C</paper-checkbox>
<paper-checkbox disabled=true >D</paper-checkbox>
<paper-checkbox disabled="true" >E</paper-checkbox>
<paper-checkbox disabled=false >F</paper-checkbox>
<paper-checkbox disabled="false">G</paper-checkbox>
<paper-checkbox [[bool]] >H</paper-checkbox>
<paper-checkbox "[[bool]]" >I</paper-checkbox>
<paper-checkbox {{bool}} >J</paper-checkbox>
<paper-checkbox "{{bool}}" >K</paper-checkbox>
</template>
<script>
(function(){
Polymer({
is: 'x-element',
properties: {
bool: {
type: String,
value: 'disabled'
}
}
});
})();
</script>
</dom-module>
</body>
</html>