Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Last active December 21, 2015 08:09
Show Gist options
  • Save jiggliemon/6275910 to your computer and use it in GitHub Desktop.
Save jiggliemon/6275910 to your computer and use it in GitHub Desktop.

Links

Enabling

Firefox Nightly about:config

  • Add a Boolean flag named dom.webcomponents.enabled; set to true
  • Shadow DOM not available

Chrome Canary chrome://flags

  • Enable experimental Web Platform features chrome://flags/#enable-experimental-web-platform-features
  • Enable Experimental JavaScript chrome://flags/#enable-javascript-harmony

JavaScript API

/**
 *  
 * 
 * 
 *
 */
var elProto = _.assign(Object.create(HTMLParagraphElement.prototype), {
  createdCallback: function () {    
    this // this is a reference to the element that will be created.  
  },
  enteredViewCallback: function () {},
  leftViewCallback: function () {},
  attributeChangedCallback: function () {}
})

document.register('element-name', elProto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment