Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <element name="x-foo" constructor="XFoo">
  2. <section>I'm an x-foo!</section>
  3. <script>
  4.   var section = this.querySelector('section');
  5.   this.register({
  6.     prototype: {
  7.       readyCallback: function() {
  8.         this.textContent = section.textContent; // this == <element>
  9.       },
  10.       foo: function() { alert('foo() called'); }
  11.     }
  12.   });
  13. </script>
  14. </element>