projects/wms-framework/src/lib/helpers/BrowserElement.ts
Provides helper functions for HTML element manipulation.
Methods |
|
Static removeChild | ||||||||||||
removeChild(parent: Node, child: Node)
|
||||||||||||
Removes a child from it's parent. NOTE: if the child does not belong to parent, no exception is thrown.
Parameters :
Returns :
void
|
export class BrowserElement {
/**
* Removes a child from it's parent.
* NOTE: if the child does not belong to parent, no exception is thrown.
*
* @static
* @param {HTMLElement} parent The parent element.
* @param {HTMLElement} child The child to remove.
* @memberof BrowserElement
*/
public static removeChild(parent: Node, child: Node): void {
try {
parent.removeChild(child);
} catch (e) {
console.warn(
'WARNING: BrowserElement.removeChild() was unable to remove the child.'
);
console.warn(e);
}
}
}