- From: Jan Olaf Krems <notifications@github.com>
- Date: Fri, 05 Oct 2018 09:05:47 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 5 October 2018 16:06:08 UTC
When reading the exports part I got super excited for a second but then I ran into the `<script>` tag. I think it would be super interesting to make "export by (HTML) id" the default. Then HTML imports could focus on being exactly HTML markup and it would be possible to cleanly split the code pieces: ```html <!-- export myCustomElementTemplate --> <template id="myCustomElementTemplate"> <div class="myDiv"> <div class="devText">Here is some amazing text</div> </div> </template> ``` And the component lives in a simple `.js` file: ```js import { myCustomElementTemplate as template } from './see-above.html'; class myCustomElement extends HTMLElement { constructor() { super(); let shadowRoot = this.attachShadow({ mode: "open" }); shadowRoot.appendChild(template.content.clone(true)); } } window.customElements.define("myCustomElement", myCustomElement); ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/645#issuecomment-427417061
Received on Friday, 5 October 2018 16:06:08 UTC