Skip to content

Instantly share code, notes, and snippets.

@csuwildcat
Created April 14, 2013 01:18
Show Gist options
  • Select an option

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

Select an option

Save csuwildcat/5380931 to your computer and use it in GitHub Desktop.
/*** Option 1 ***/
<element tagname="x-foo">
<script>
// By default, the tag name is used to generate the
// named constructor object - without rebinding 'this'
XFooElement.prototype.bar = ...
</script>
</element>
/*** Option 2 ***/
<element tagname="x-foo" extends="SVGElement" constructor="SuperVG">
<script>
// By choice, the developer can extend from an existing
// tag using extends="", and/or specify a non-default constructor
// name via constructor="" - again, without rebinding 'this'
SuperVG.prototype.bar = ...
</script>
</element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment