Skip to content

Polymer 2.x mixin that provides some useful methods for data bindings.

Notifications You must be signed in to change notification settings

SupportClass/sc-data-binding-helpers

Repository files navigation

Polymer.SCDataBindingHelpers Published on webcomponents.org Build Status

A Polymer 2.x mixin that provides some useful methods for data bindings. See the listing on webcomponents.org for full documentation (You'll need to click on "Show N protected methods" to see them).

Example

<dom-module id="my-element">
    <template>
        <style>
            :host {
                display: block;
            }
        </style>
        
        <template is="dom-if" if="[[_isTruthy(foo)]]">
            foo is: truthy
        </template>
        
        <template is="dom-if" if="[[_isFalsey(foo)]]">
            foo is: falsey
        </template>
    </template>
    
    <script>
        /**
         * @customElement
         * @polymer
         * @appliesMixin Polymer.SCDataBindingHelpers
         */
        class MyElement extends Polymer.SCDataBindingHelpers(Polymer.Element) {
            static get is() { 
                return 'my-element';
            }
            
            static get properties() { 
                return {
                    foo: {
                        type: String,
                        value: 'foo'
                    }
                };
            }
        }
        
        customElements.define(MyElement.is, MyElement);
    </script>
</dom-module>

About

Polymer 2.x mixin that provides some useful methods for data bindings.

Resources

Stars

Watchers

Forks

Packages

No packages published