Last active
December 15, 2015 05:19
-
-
Save sjmiles/5207722 to your computer and use it in GitHub Desktop.
Basic example using Web Components/Custom Elements
This file contains hidden or 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
<!DOCTYPE html> | |
<!-- | |
Copyright 2013 The Toolkitchen Authors. All rights reserved. | |
Use of this source code is governed by a BSD-style | |
license that can be found in the LICENSE file. | |
--> | |
<html> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
<script src="../../../WebComponents/web-components.js"></script> | |
<script src="../../../CustomElements/custom-elements.js"></script> | |
</head> | |
<body> | |
<x-foo></x-foo> | |
<element name="x-foo"> | |
<script> | |
this.register && this.register({ | |
prototype: { | |
readyCallback: function() { | |
this.textContent = 'Hello World'; | |
} | |
} | |
}); | |
</script> | |
</element> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment