Skip to content

Instantly share code, notes, and snippets.

@MatthiasKainer
Last active July 4, 2020 21:20
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 MatthiasKainer/ef075d9c0200964351b1c0a4392b9772 to your computer and use it in GitHub Desktop.
Save MatthiasKainer/ef075d9c0200964351b1c0a4392b9772 to your computer and use it in GitHub Desktop.
import {
LitElement,
customElement,
html,
css,
property
} from "lit-element";
const blockStyle = css`:host { display: block; }`
@customElement("hello-world")
export class HelloWorld extends LitElement {
@property()
who: string = "noone";
static get styles() {
return [blockStyle];
}
render() {
return html`
Hello ${this.who}!
`;
}
}
@customElement("greet-em")
export class GreetEm extends LitElement {
render() {
return html`
<div>
${["george", "john"].map(
n =>
html`
<hello-world who="${n}"></hello-world>
`
)}
</div>
`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment