Does the remove child method provided by polymer takes care of cleaning all the dependencies such as event listeners, binded vars, etc. ?
Polymer.dom(parent).removeChild(node)
I want to add/remove many elements programmatically and want to make sure nothing is leaking or nothing is still watching for objects that do not exist anymore.
To add:
// Create the element
var paperListbox = document.createElement('paper-listbox');
paperListbox.setAttribute('depth', depth);
this.listen(paperListbox, 'iron-select', 'selectionChanged');
// add it
Polymer.dom(this.$.container).appendChild(paperListbox);
To remove:
// get node of interest
var node0 = Polymer.dom(this.$container).childNodes[0];
Polymer.dom(this.$.container).removeChild(node0)
Does such a pattern would allow me to add/remove lot of elements properly?