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 issue was fixed a few releases ago and should also work fine in Polymer 0.3.x onwards. If you run into any further issues with this.remove()
within the scope of an element, please file an issue.