code: function detachAndClean() {
          angular.element($document[0].body).removeClass('md-dialog-is-showing');
  
          // Reverse the container stretch if using a content element.
          if (options.contentElement) {
            options.reverseContainerStretch();
          }
  
          // Exposed cleanup function from the $mdCompiler.
          options.cleanupElement();
  
          // Restores the focus to the origin element if the last interaction upon opening was a keyboard.
          if (!options.$destroy && options.originInteraction === 'keyboard') {
            options.origin.focus();
          }
        }
docs: Detach the element