Skip to content

Instantly share code, notes, and snippets.

@csuwildcat
Created April 15, 2013 23:57
Show Gist options
  • Select an option

  • Save csuwildcat/5392291 to your computer and use it in GitHub Desktop.

Select an option

Save csuwildcat/5392291 to your computer and use it in GitHub Desktop.
/*** Declaritive Definition ***/
<element tagname="x-foo">
<prototype>
this.bar = function(){ ... }
this.registeredCallback = function(){
document.addEventListener('click', function(event){
if (event.target.nodeName == 'X-FOO'){
// Do something when any <x-foo> is clicked
}
})
}
</prototype>
</element>
/*** HTML Usage ***/
<x-foo>BAR!</x-foo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment