Sometimes you only want a field to show when certain other fields have a (particular) value. The `form-show-if` web component enables that.
10 reposts34 likes
Sometimes you only want a field to show when certain other fields have a (particular) value. The `form-show-if` web component enables that.
10 reposts34 likes
One issue, your code will only work when the Web Component is defined AFTER all DOM was parsed, because the connectedCallback fires on the OPENING tag. Thus when you define your Web Component EARLY (to prevent FOUCs) there is no innerHTML JSFiddle and link to blogpost: jsfiddle.net/WebComponent...
There are a lot of cases where a good expression language is really useful. I wish HTML had one baked in. We'll definitely need one if we ever get declarative custom elements. Meanwhile, I do have a battle-tested one here, evolved from the Polymer/Dart days: www.npmjs.com/package/@hex...