Skip to content

Instantly share code, notes, and snippets.

@deebloo
Last active March 17, 2020 20:02
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 deebloo/4a38c7311d56455fdba9b43e72498b33 to your computer and use it in GitHub Desktop.
Save deebloo/4a38c7311d56455fdba9b43e72498b33 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Element</title>
</head>
<body>
<script type="module">
import { html, render } from 'https://unpkg.com/lit-html?module';
class MyElement extends HTMLElement {
greeting: string = 'Hello World';
attachedCallback() {
this.render();
}
render() {
render(html`${this.greeting}`)
}
}
customElements.define('my-element', MyElement);
</script>
<my-element></my-element>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment