blaze.js
function (elem, func) {
    var elt = new TeardownCallback(func);

    var propName = DOMBackend.Teardown._CB_PROP;
    if (! elem[propName]) {
      // create an empty node that is never unlinked
      elem[propName] = new TeardownCallback;

      // Set up the event, only the first time.
      $jq(elem).on(DOMBackend.Teardown._JQUERY_EVENT_NAME, NOOP);
    }

    elt.linkBefore(elem[propName]);

    return elt; // so caller can call stop()
  }
function (elem, func) {
    var elt = new TeardownCallback(func);

    var propName = DOMBackend.Teardown._CB_PROP;
    if (! elem[propName]) {
      // create an empty node that is never unlinked
      elem[propName] = new TeardownCallback;

      // Set up the event, only the first time.
      $jq(elem).on(DOMBackend.Teardown._JQUERY_EVENT_NAME, NOOP);
    }

    elt.linkBefore(elem[propName]);

    return elt; // so caller can call stop()
  }
function ( elem , func ) { var elt = new TeardownCallback ( func ) ; var propName = DOMBackend . Teardown . _CB_PROP ; if ( ! elem [ propName ] ) { // create an empty node that is never unlinked elem [ propName ] = new TeardownCallback ; // Set up the event, only the first time. $jq ( elem ) . on ( DOMBackend . Teardown . _JQUERY_EVENT_NAME , NOOP ) ; } elt . linkBefore ( elem [ propName ] ) ; return elt ; // so caller can call stop() }
Registers a callback function to be called when the given element or one of its ancestors is removed from the DOM via the backend library. The callback function is called at most once, and it receives the element in question as an argument.
Registers a callback function to be called when the given element or one of its ancestors is removed from the DOM via the backend library . The callback function is called at most once and it receives the element in question as an argument .