ngx-dynamic-hooks
Version:
Automatically insert live Angular components into a dynamic string of content (based on their selector or any pattern of your choice) and render the result in the DOM.
9 lines (8 loc) • 541 B
TypeScript
/**
* A function that observes an HTMLElement and triggers a callback when new elements are added to it.
* Does NOT trigger for Angular components or logic, only for neutral HTML elements.
*
* @param content - The HTMLElement to watch for element additions
* @param callbackFn - The callback function to call when a change occurs. Will be called with the closest parent element of all added elements.
*/
export declare const observeElement: (content: HTMLElement, callbackFn: (parentElement: HTMLElement) => void) => MutationObserver;