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 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...
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...
I'm trying the example from google developer site and I'm getting Error: "TypeError: Illegal constructor. What's wrong and How to fix it?  class FancyButton extends HTMLButtonElement {   constructor() {     super(); // always call sup...
I have defined a custom element and I want to execute a script only when the custom element is upgraded to its registered type. The use case is that I must call a custom method.  My main html file looks like this:  <project-list></project-li...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.