dap-design-system
Version:
Official design system for the DÁP (dap.gov.hu)
58 lines (57 loc) • 1.52 kB
JavaScript
function h(f, p) {
const { component: b, inputs: s, outputs: i, content: u, environmentInjector: a } = p;
let e = null;
const n = [];
return {
render: (r) => {
try {
u && (r.innerHTML = u);
const t = {
hostElement: r
};
a && (t.environmentInjector = a), e = f(b, t), s && e && Object.entries(s).forEach(([o, c]) => {
e.setInput(o, c);
}), i && e && Object.entries(i).forEach(([o, c]) => {
const l = e.instance[o];
if (l && typeof l.subscribe == "function") {
const g = l.subscribe(c);
n.push(g);
}
}), e && e.changeDetectorRef.detectChanges();
} catch (t) {
console.error(
"Error rendering Angular component in datatable cell:",
t
), r.textContent = "Error rendering cell";
}
},
cleanup: () => {
if (n.forEach((r) => {
try {
r.unsubscribe();
} catch (t) {
console.error(
"Error unsubscribing from Angular output in datatable cell:",
t
);
}
}), n.length = 0, e !== null)
try {
e.destroy();
} catch (r) {
console.error(
"Error destroying Angular component in datatable cell:",
r
);
} finally {
e = null;
}
}
};
}
const d = h;
export {
d as createAngularCell,
h as createAngularCellWithFactory
};
//# sourceMappingURL=angular.js.map