$timeout(function () {
for (var i = 0; i < generatedElems.length; i++) {
var g = generatedElems[i];
if (!document.body.contains(g.el[0])) {
generatedElems.splice(i, 1);
g.ref.remove();
}
}
});
This leaves the generatedElems detached from the DOM whenever ngf-select is destroyed and is not subsequently recreated.
Perhaps it is possible to move the logic into $destroy handler that is right above $timeout?
scope.$on('$destroy', function () {
if (!isInputTypeFile()) fileElem.parent().remove();
angular.forEach(unwatches, function (unwatch) {
unwatch();
});
});
generatedElems array gets cleaned up whenever the ngf-select is initialized through the use of $timeout.
L32-L240
This leaves the generatedElems detached from the DOM whenever ngf-select is destroyed and is not subsequently recreated.
Perhaps it is possible to move the logic into $destroy handler that is right above $timeout?
L225-L230