Directory

← Back

sc-data-binding-helpers

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

Author

Contributors

Rating

[ This description is mirrored from README.md at github.com/SupportClass/sc-data-binding-helpers on 2019-05-10 ]

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>

Links

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

  • polymer#Polymer/polymer#^2.0.2
Released
2018-12-07
Maturity
IMPORTED
License
MIT License

Compatibility

Framework
Polymer 2.0+
Browser
Browser Independent
Online