I am looking into structuring vanilla web-components. I have previously used Polymer and like the fact that you can have the template, styles and JavaScript in one file for your component. I want to achieve this with 'vanilla' web components...
I'm trying to detect whether a custom element with a specific name was registered or not. Is there a way to make such check?  Or is there a way to get list of registered custom elements?  I do document.registerElement, but what else is there? Is...
I am creating a web component using native implementation, which in it's html template has links to images. However, those links only work if they are absolute, or relative to the main document, which means, that that component is not reusable, o...
I don't know how to make a disqus comments code to work inside of my custom elements.    Structure of my site:  | index.html --------\ my-app.html (custom element) ----------------\ my-testView1.html (custom element) ----------------\ my-testView...
dropdown menu is created in shadowDOM  almost perfect,  but the problem is how to hide the dropdown menu when click on any where else in window  class NavComponent extends HTMLElement {     constructor() {         super();          let template = doc...
Using Web Components without any framework, what is the proper way to implement a custom event? For example, say I have a custom element x-pop-out that has a custom event of pop I would want all of the following to work:  <x-pop-out onpop="som...
If I had a script like this  <template id="x-foo-from-template">     <script src="/js/main.js"></script> </template>  <script>     customElements.define('my-header', class extends HTMLElement {...
Due to the renaming of some class methods (attached/detached to connected/disconnected) and removal of createdCallback in favor of constructors (which is a good thing!), I find myself writing my WebComponent base class (class-factory mixin) as follow...
Here is my jsBin.  The parent-element sets the value of the --custom-color property in the child-element. I want to get the value of that property from the JS in the child-element.  Here is the documentation but I can not find it mentioned anywhere i...
Code  Consider the following Polymer custom element:    <dom-module id="test-element">  <template>     <input type="text" value="{{value}}">     <button>Reset</button> </template>  <scrip...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.