0

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?

vzhen
  • 11,137
  • 13
  • 56
  • 87

1 Answers1

1

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.

Justin XL
  • 38,763
  • 7
  • 88
  • 133
  • What if we doing this inside `polymer-element` ? what should be use? – vzhen Feb 15 '15 at 01:37
  • You don't actually need to do this inside a `polymer-element` because the whole point of having this `auto-binding template` is to enable data binding outside of a `polymer-element`. Within the element, you have data binding support automatically. – Justin XL Feb 15 '15 at 02:00
  • then i think my question is about ` should we make it custom element `? i will create another question later. – vzhen Feb 15 '15 at 06:31