Skip to content

Instantly share code, notes, and snippets.

@enjikaka
Last active August 6, 2017 17:28
Show Gist options
  • Select an option

  • Save enjikaka/1f709beeaecd944073d7384cc96a0d37 to your computer and use it in GitHub Desktop.

Select an option

Save enjikaka/1f709beeaecd944073d7384cc96a0d37 to your computer and use it in GitHub Desktop.
<link rel="import" href="template-component.html">
<script>
class HelloWorld extends TemplateComponent {
constructor() {
super(HelloWorld.is);
}
static get is() {
return 'hello-world';
}
getState() {
return {
hello: "world"
};
}
}
window.customElements.define(HelloWorld.is, HelloWorld);
</script>
<template>
<style>
/* This is scoped! */
p {
color: blue;
font-weight: bold;
}
</style>
<h1>Welcome!</h1>
<p>Awesome song is ${this.world}</p>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment