Search code examples
polymerfirebase-polymer

What is template-bound in polymer?


I noticed there is a template-bound in firebase polymer firebase-login.html after searching polymer documentation cannot find out what is that.

also, any polymer events reference in documentation?


Solution

  • This is the event that fires after the data binding happens in a Polymer's auto-binding template.

    <template id="myTemplate" is="auto-binding">
    </template>
    <script>
        var template = document.getElementById("myTemplate");
        template.addEventListener('template-bound', function() {
            console.log('ready');
        });
    </script>
    

    The auto-binding template inserts the instances it creates immediately after itself in the DOM tree (not in its shadow DOM).

    After adding the instances, the auto-binding template fires the template-bound event.

    You can read more from here.