What is the recommended method for removing Polymer elements from the page/registry?

StackOverflow https://stackoverflow.com/questions/23611165

  •  20-07-2023
  •  | 
  •  

Pregunta

We'd like to be able to replace element definitions at run-time. No need to assume that elements in the DOM will be magically updated. We'd just like to be able to recycle the element name.

What is the recommended method for removing Polymer elements from the page/registry entirely?

e.g. Remove for version 1, add for version 2.

¿Fue útil?

Solución

You can't. Once a custom element name is registered on the page, it can't be re-registered. Try running var XFoo = document.registerElement('x-foo'); twice in the console in Chrome.

In a future version of the Custom Elements spec there may be an element registry to manage. But that's a ways off.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top