code: function createDatepickerInstance(template) {
      var outputElement = $compile(template)(pageScope);
      pageScope.$apply();
  
      ngElement = outputElement[0].tagName == 'MD-DATEPICKER' ?
          outputElement : outputElement.find('md-datepicker');
      element = ngElement[0];
      scope = ngElement.isolateScope();
      controller = ngElement.controller('mdDatepicker');
  
      return outputElement;
    }
docs: Compile and link the given template and store values for element, scope, and controller.
  @param {string} template
  @returns {angular.JQLite} The root compiled element.