I have a polymer element which has a costum element inside it. I want to remove everything (parent and child) when I click on it.
The problem is that every time I close an instance of the parent element I get an error. I think it's related to the fact I'm removing an element that has an element inside.
How can I remove it correctly?
Here's the method code:
closeWindow: function (event, detail, sender) {
this.firstChild.remove();
this.remove();
}
Here's the error I'm having:
Uncaught TypeError: Cannot read property 'length' of undefined
Here's an image of the error:
this.remove()
? – ebidel