Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _subscribeOnElementRemoval(element: Element): void {
events.off(element, DX_REMOVE_EVENT, this._onDxRemove);
events.one(element, DX_REMOVE_EVENT, this._onDxRemove);
}
childView.rootNodes.forEach((element) => {
if (element.nodeType === 1) {
this.renderer.addClass(element, DX_TEMPLATE_WRAPPER_CLASS);
}
events.one(element, 'dxremove', ({}, params) => {
if (!params || !params._angularIntegration) {
childView.destroy();
}
});
});
name,
placeholder
);
const element = mountedTemplate.$el;
if (element.classList) {
element.classList.add(DX_TEMPLATE_WRAPPER_CLASS);
}
if (element.nodeType === Node.TEXT_NODE) {
const removalListener = document.createElement(container.nodeName === "TABLE" ? "tbody" : "span");
removalListener.style.display = "none";
container.appendChild(removalListener);
events.one(removalListener, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
} else {
events.one(element, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
}
return element;
}
};
this._component,
scopeData,
name,
placeholder
);
const element = mountedTemplate.$el;
if (element.classList) {
element.classList.add(DX_TEMPLATE_WRAPPER_CLASS);
}
if (element.nodeType === Node.TEXT_NODE) {
const removalListener = document.createElement(container.nodeName === "TABLE" ? "tbody" : "span");
removalListener.style.display = "none";
container.appendChild(removalListener);
events.one(removalListener, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
} else {
events.one(element, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
}
return element;
}
};