'How to append template in polymer 3
Trying to append template in the html, but not working, this is a simple concept but not working i am new in polymer 3. So, How to get solution for that.
constructor() {
super();
const template = document.createElement('template');
template.innerHTML = 'Hello World';
this.shadowRoot = this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
}
Demo: https://stackblitz.com/edit/polymer-3-template-byge9j?file=index.js,custom-element.js
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|