Created
July 29, 2016 10:28
-
-
Save evolutionxbox/7016c6c19e117a82fb87e91683205447 to your computer and use it in GitHub Desktop.
Exploring Custom Elements using the RMP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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