code: function onRemove(scope, element, opts) {
        opts.cleanupInteraction();
        opts.cleanupBackdrop();
        opts.cleanupResizing();
        opts.hideBackdrop();
  
        // Before the menu is closing remove the clickable class.
        element.removeClass('md-clickable');
  
        // For navigation $destroy events, do a quick, non-animated removal,
        // but for normal closes (from clicks, etc) animate the removal
  
        return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then(detachAndClean);
  
        /**
         * For normal closes, animate the removal.
         * For forced closes (like $destroy events), skip the animations
         */
        function animateRemoval() {
          return $animateCss(element, {addClass: 'md-leave'}).start();
        }
  
        /**
         * Detach the element
         */
        function detachAndClean() {
          element.removeClass('md-active');
          detachElement(element, opts);
          opts.alreadyOpen = false;
        }
  
      }
docs: Removing the menu element from the DOM and remove all associated event listeners
  and backdrop