lib/bundle.js
/**
 * Detach a widget from its host DOM node.
 *
 * @param widget - The widget to detach from the DOM.
 *
 * @throws Will throw an error if the widget is not a root widget,
 *   or if the widget is not attached to the DOM.
 *
 * #### Notes
 * This function ensures that a `'before-detach'` message is dispatched
 * to the hierarchy. It should be used in lieu of manual DOM detachment.
 */
Detach a widget from its host DOM node.
@param widget - The widget to detach from the DOM.

@throws Will throw an error if the widget is not a root widget,
or if the widget is not attached to the DOM.

Notes
This function ensures that a `'before-detach'` message is dispatched
to the hierarchy. It should be used in lieu of manual DOM detachment.
Detach a widget from its host DOM node . @param widget - The widget to detach from the DOM . @throws Will throw an error if the widget is not a root widget or if the widget is not attached to the DOM . Notes This function ensures that a ` ' before - detach ' ` message is dispatched to the hierarchy . It should be used in lieu of manual DOM detachment .
function detachWidget(widget) {
    if (widget.parent) {
        throw new Error('only a root widget can be detached from the DOM');
    }
    if (!widget.isAttached || !document.body.contains(widget.node)) {
        throw new Error('widget is not attached to the DOM');
    }
    phosphor_messaging_1.sendMessage(widget, exports.MSG_BEFORE_DETACH);
    widget.node.parentNode.removeChild(widget.node);
}
function detachWidget ( widget ) { if ( widget . parent ) { throw new Error ( 'only a root widget can be detached from the DOM' ) ; } if ( ! widget . isAttached || ! document . body . contains ( widget . node ) ) { throw new Error ( 'widget is not attached to the DOM' ) ; } phosphor_messaging_1 . sendMessage ( widget , exports . MSG_BEFORE_DETACH ) ; widget . node . parentNode . removeChild ( widget . node ) ; }
Detach a widget from its host DOM node.
Detach a widget from its host DOM node .