Is it possible to use conditional attributes in Polymer 1.0? I've try to find it in the migration guide and also in Road to polymer without success.
I know that in Polymer 1.0 there's a new conditional template, but I don't want to duplicate my code.
So in 0.5 version we can had something like:
<input readonly?={{my-boolean-expression}} (...)>
And, in 1.0, should we do it with a template?
<template is="dom-if" if="{{my-boolean-expression}}">
<input readonly (...)>
</template>
<template is="dom-if" if="!{{my-boolean-expression}}">
<input (...)>
</template>
See the docs here.
What you will want to do is:
<input readonly$="{{my-boolean-expression}}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With