Created
August 6, 2017 18:07
-
-
Save enjikaka/7a4b22b806f489d9f4498d5e83d4b65c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link rel="import" href="template-component.html"> | |
| <script> | |
| class SsrData extends TemplateComponent { | |
| constructor () { | |
| super(SsrData.is); | |
| } | |
| static get is () { | |
| return 'ssr-data'; | |
| } | |
| getState () { | |
| return JSON.parse(this.innerHTML.trim()); | |
| } | |
| } | |
| window.customElements.define(SsrData.is, SsrData); | |
| </script> | |
| <template> | |
| <style> | |
| /* This is scoped! */ | |
| p { | |
| color: red; | |
| font-style: italic; | |
| } | |
| </style> | |
| <p>I am ${this.name}</p> | |
| </template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment