code: function onShow(scope, element, options, controller) {
        angular.element($document[0].body).addClass('md-dialog-is-showing');
  
        var dialogElement = element.find('md-dialog');
  
        // Once a dialog has `ng-cloak` applied on his template the dialog animation will not work properly.
        // This is a very common problem, so we have to notify the developer about this.
        if (dialogElement.hasClass('ng-cloak')) {
          var message = '$mdDialog: using `<md-dialog ng-cloak>` will affect the dialog opening animations.';
          $log.warn(message, element[0]);
        }
  
        captureParentAndFromToElements(options);
        configureAria(dialogElement, options);
        showBackdrop(scope, element, options);
        activateListeners(element, options);
  
        return dialogPopIn(element, options)
          .then(function() {
            lockScreenReader(element, options);
            warnDeprecatedActions();
            focusOnOpen();
          });
  
        /**
         * Check to see if they used the deprecated .md-actions class and log a warning
         */
        function warnDeprecatedActions() {
          if (element[0].querySelector('.md-actions')) {
            $log.warn('Using a class of md-actions is deprecated, please use <md-dialog-actions>.');
          }
        }
  
        /**
         * For alerts, focus on content... otherwise focus on
         * the close button (or equivalent)
         */
        function focusOnOpen() {
          if (options.focusOnOpen) {
            var target = $mdUtil.findFocusTarget(element) || findCloseButton() || dialogElement;
            target.focus();
          }
  
          /**
           * If no element with class dialog-close, try to find the last
           * button child in md-actions and assume it is a close button.
           *
           * If we find no actions at all, log a warning to the console.
           */
          function findCloseButton() {
            return element[0].querySelector('.dialog-close, md-dialog-actions button:last-child');
          }
        }
      }
docs: Show method for dialogs