Skip to content

Instantly share code, notes, and snippets.

@evolutionxbox
Created July 29, 2016 10:28
Show Gist options
  • Save evolutionxbox/7016c6c19e117a82fb87e91683205447 to your computer and use it in GitHub Desktop.
Save evolutionxbox/7016c6c19e117a82fb87e91683205447 to your computer and use it in GitHub Desktop.
Exploring Custom Elements using the RMP.
var MyElement = new function MyElement() {
var obj = Object.create(HTMLElement.prototype);
var self = {
createdCallback: function createdCallback() {
console.log('createdCallback', this);
},
attachedCallback: function attachedCallback() {
console.log('attachedCallback', this);
},
detachedCallback: function detachedCallback() {
console.log('detachedCallback', this);
}
};
document.registerElement('my-element', {
prototype: obj
}
};
// MyElement; - still figuring this out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment