function optTemplate(options, compileOpts, ngSelectedExpression) {
    var optionsTpl = '';
    var ngSelectedTemplate = ngSelectedExpression ? ' ng-selected="' + ngSelectedExpression + '"' : '';

    if (angular.isArray(options)) {
      $rootScope.$$values = options;
      var renderValueAs = compileOpts ? compileOpts.renderValueAs || 'value' : 'value';
      optionsTpl = '<md-option ng-repeat="value in $$values" ng-value="value"' + ngSelectedTemplate + '>' +
        '<div class="md-text">{{' + renderValueAs + '}}</div></md-option>';
    } else if (angular.isString(options)) {
      optionsTpl = options;
    }

    return optionsTpl;
  }
@param {any[]=} options Array of option values to create md-options from
@param {object=} compileOpts
@param {object=} ngSelectedExpression If defined, sets the expression used by ng-selected.
@return {string} template containing the generated md-options