code: function captureParentAndFromToElements(options) {
            options.origin = angular.extend({
              element: null,
              bounds: null,
              focus: angular.noop
            }, options.origin || {});
  
            options.parent   = getDomElement(options.parent, $rootElement);
            options.closeTo  = getBoundingClientRect(getDomElement(options.closeTo));
            options.openFrom = getBoundingClientRect(getDomElement(options.openFrom));
  
            if (options.targetEvent) {
              options.origin = getBoundingClientRect(options.targetEvent.target, options.origin);
              options.originInteraction = $mdInteraction.getLastInteractionType();
            }
  
  
            /**
             * Identify the bounding RECT for the target element
             *
             */
            function getBoundingClientRect (element, orig) {
              var source = angular.element((element || {}));
              if (source && source.length) {
                // Compute and save the target element's bounding rect, so that if the
                // element is hidden when the dialog closes, we can shrink the dialog
                // back to the same position it expanded from.
                //
                // Checking if the source is a rect object or a DOM element
                var bounds = {top:0,left:0,height:0,width:0};
                var hasFn = angular.isFunction(source[0].getBoundingClientRect);
  
                return angular.extend(orig || {}, {
                    element : hasFn ? source : undefined,
                    bounds  : hasFn ? source[0].getBoundingClientRect() : angular.extend({}, bounds, source[0]),
                    focus   : angular.bind(source, source.focus),
                });
              }
            }
  
            /**
             * If the specifier is a simple string selector, then query for
             * the DOM element.
             */
            function getDomElement(element, defaultElement) {
              if (angular.isString(element)) {
                element = $document[0].querySelector(element);
              }
  
              // If we have a reference to a raw dom element, always wrap it in jqLite
              return angular.element(element || defaultElement);
            }
  
          }
docs: Capture originator/trigger/from/to element information (if available)
  and the parent container for the dialog; defaults to the $rootElement
  unless overridden in the options.parent