- From: Alex Godoy Wolff <notifications@github.com>
- Date: Mon, 26 Jun 2017 06:16:27 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 26 June 2017 13:17:26 UTC
Hey guys, currently I use webpack + plugin "raw loader" to do this. HTML Imports it's sucks. I wish I could do that native. I know you're arguing and just wanted to contribute as I do today. I do not want to use, react, I do not want to use webpack, I want native Web Components.
Sorry for poor English.
```js
import templateHTML from './report-date-picker.html';
export class DatePicker extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
const template = document.createElement('template');
template.innerHTML = templateHTML;
shadowRoot.appendChild(template.content.firstChild.content);
}
connectedCallback(){
}
}
```
> report-date-picker.html
``` html
<template>
<style>
:host {
}
</style>
</template>
```
--
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-311056090
Received on Monday, 26 June 2017 13:17:26 UTC