Skip to content

Instantly share code, notes, and snippets.

@newbornfrontender
Last active October 1, 2018 05:53
Show Gist options
  • Save newbornfrontender/bb83c6f134cfe531046485143c5578e4 to your computer and use it in GitHub Desktop.
Save newbornfrontender/bb83c6f134cfe531046485143c5578e4 to your computer and use it in GitHub Desktop.
Test Polymer and Lit Element
<!doctype html>
<html>
<head>
<!-- Polyfills for Microsoft Edge and Firefox-->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
<title>Test Polymer and Lit Element</title>
</head>
<body>
<script type="module">
import { LitElement, html } from 'https://unpkg.com/@polymer/lit-element@latest/lit-element.js?module';
class MyApp extends LitElement {
static get properties () { return {
msg: {
type: String,
},
}};
render () { return html`
<style>
span {
color: blue;
}
</style>
<h1>Hello <span>${this.msg}</span>!</h1>
`};
};
customElements.define('my-app', MyApp);
</script>
<my-app msg="world"></my-app>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment