code: function(urlMatcher, params, options) {
          if (!urlMatcher.validates(params)) return null;
  
          var isHtml5 = $locationProvider.html5Mode();
          if (angular.isObject(isHtml5)) {
            isHtml5 = isHtml5.enabled;
          }
  
          isHtml5 = isHtml5 && $sniffer.history;
          
          var url = urlMatcher.format(params);
          options = options || {};
  
          if (!isHtml5 && url !== null) {
            url = "#" + $locationProvider.hashPrefix() + url;
          }
  
          // Handle special hash param, if needed
          if (url !== null && params && params['#']) {
            url += '#' + params['#'];
          }
  
          url = appendBasePath(url, isHtml5, options.absolute);
  
          if (!options.absolute || !url) {
            return url;
          }
  
          var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();
          port = (port === 80 || port === 443 ? '' : ':' + port);
  
          return [$location.protocol(), '://', $location.host(), port, slash, url].join('');
        }
docs: @ngdoc function
  @name ui.router.router.$urlRouter#href
  @methodOf ui.router.router.$urlRouter
  
  @description
  A URL generation method that returns the compiled URL for a given
  {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.
  
  @example
  <pre>
  $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
  person: "bob"
  });
  // $bob == "/about/bob";
  </pre>
  
  @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.
  @param {object=} params An object of parameter values to fill the matcher's required parameters.
  @param {object=} options Options object. The options are:
  
  - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
  
  @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`