Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2016 00:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
From Zero to Polymer: Step 02 - template
<!DOCTYPE html>
<html lang="en">
<template id="my-element-template">
<p>My <b>custom element</b> markup!</p>
var MyElementProto = Object.create(HTMLElement.prototype);
MyElementProto.createdCallback = function() {
var t = document.querySelector('#my-element-template');
var clone = document.importNode(t.content, true);
var MyElement = document.registerElement(
'my-element', { prototype: MyElementProto }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment