Skip to content

Instantly share code, notes, and snippets.

@rektide
Created July 9, 2012 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rektide/3078197 to your computer and use it in GitHub Desktop.
Save rektide/3078197 to your computer and use it in GitHub Desktop.
Web Components attempt
<?xml version="1.0"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>ping pong component</title>
</head>
<body>
<script>
console.log("MAIN")
</script>
<element extends="div" name="x-idb-paddle">
<script>
console.log("THIS",this,window==this,this.lifecycle,this.reflectAttribute)
function explain(label){
return function(){
console.log(label,arguments,arguments.callee,arguments.caller)
}
}
/* // NO .lifecycle!?!? First problem. :(
this.lifecycle({
created: explain("created"),
attributeChanged: explain("attr"),
inserted: explain("inserted"),
removed: explain("removed")
})
*/
</script>
<!--
this renders not as a template, it just dumps to screen.
Second problem. :(
-->
<template>
<div id="display" style="clear:both;">
hi
<button value="hit" id="hit"/>
</div>
</template>
</element>
<div is="idb-paddle" one="false">foo</div>
<div is="idb-paddle" one="true">foo</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment