lib/angular/js/ng/location.js
function LocationHashbangUrl(appBase, hashPrefix) {
  var appBaseNoFile = stripFile(appBase);

  parseAbsoluteUrl(appBase, this, appBase);


  /**
   * Parse given hashbang url into properties
   * @param {string} url Hashbang url
   * @private
   */
  this.$$parse = function(url) {
    var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
    var withoutHashUrl = withoutBaseUrl.charAt(0) == '#'
        ? beginsWith(hashPrefix, withoutBaseUrl)
        : (this.$$html5)
          ? withoutBaseUrl
          : '';

    if (!isString(withoutHashUrl)) {
      throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url,
          hashPrefix);
    }
    parseAppUrl(withoutHashUrl, this, appBase);

    this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);

    this.$$compose();

    /*
     * In Windows, on an anchor node on documents loaded from
     * the filesystem, the browser will return a pathname
     * prefixed with the drive name ('/C:/path') when a
     * pathname without a drive is set:
     *  * a.setAttribute('href', '/foo')
     *   * a.pathname === '/C:/foo' //true
     *
     * Inside of Angular, we're always using pathnames that
     * do not include drive names for routing.
     */
    function removeWindowsDriveName (path, url, base) {
      /*
      Matches paths for file protocol on windows,
      such as /C:/foo/bar, and captures only /foo/bar.
      */
      var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;

      var firstPathSegmentMatch;

      //Get the relative path from the input URL.
      if (url.indexOf(base) === 0) {
        url = url.replace(base, '');
      }

      // The input URL intentionally contains a first path segment that ends with a colon.
      if (windowsFilePathExp.exec(url)) {
        return path;
      }

      firstPathSegmentMatch = windowsFilePathExp.exec(path);
      return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
    }
  };

  /**
   * Compose hashbang url and update `absUrl` property
   * @private
   */
  this.$$compose = function() {
    var search = toKeyValue(this.$$search),
        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';

    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
    this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
  };

  this.$$rewrite = function(url) {
    if(stripHash(appBase) == stripHash(url)) {
      return url;
    }
  };
}
function LocationHashbangUrl(appBase, hashPrefix) {
  var appBaseNoFile = stripFile(appBase);

  parseAbsoluteUrl(appBase, this, appBase);


  /**
   * Parse given hashbang url into properties
   * @param {string} url Hashbang url
   * @private
   */
  this.$$parse = function(url) {
    var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
    var withoutHashUrl = withoutBaseUrl.charAt(0) == '#'
        ? beginsWith(hashPrefix, withoutBaseUrl)
        : (this.$$html5)
          ? withoutBaseUrl
          : '';

    if (!isString(withoutHashUrl)) {
      throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url,
          hashPrefix);
    }
    parseAppUrl(withoutHashUrl, this, appBase);

    this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);

    this.$$compose();

    /*
     * In Windows, on an anchor node on documents loaded from
     * the filesystem, the browser will return a pathname
     * prefixed with the drive name ('/C:/path') when a
     * pathname without a drive is set:
     *  * a.setAttribute('href', '/foo')
     *   * a.pathname === '/C:/foo' //true
     *
     * Inside of Angular, we're always using pathnames that
     * do not include drive names for routing.
     */
    function removeWindowsDriveName (path, url, base) {
      /*
      Matches paths for file protocol on windows,
      such as /C:/foo/bar, and captures only /foo/bar.
      */
      var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;

      var firstPathSegmentMatch;

      //Get the relative path from the input URL.
      if (url.indexOf(base) === 0) {
        url = url.replace(base, '');
      }

      // The input URL intentionally contains a first path segment that ends with a colon.
      if (windowsFilePathExp.exec(url)) {
        return path;
      }

      firstPathSegmentMatch = windowsFilePathExp.exec(path);
      return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
    }
  };

  /**
   * Compose hashbang url and update `absUrl` property
   * @private
   */
  this.$$compose = function() {
    var search = toKeyValue(this.$$search),
        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';

    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
    this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
  };

  this.$$rewrite = function(url) {
    if(stripHash(appBase) == stripHash(url)) {
      return url;
    }
  };
}
function LocationHashbangUrl ( appBase , hashPrefix ) { var appBaseNoFile = stripFile ( appBase ) ; parseAbsoluteUrl ( appBase , this , appBase ) ; /**
   * Parse given hashbang url into properties
   * @param {string} url Hashbang url
   * @private
   */ this . $$parse = function ( url ) { var withoutBaseUrl = beginsWith ( appBase , url ) || beginsWith ( appBaseNoFile , url ) ; var withoutHashUrl = withoutBaseUrl . charAt ( 0 ) == '#' ? beginsWith ( hashPrefix , withoutBaseUrl ) : ( this . $$html5 ) ? withoutBaseUrl : '' ; if ( ! isString ( withoutHashUrl ) ) { throw $locationMinErr ( 'ihshprfx' , 'Invalid url "{0}", missing hash prefix "{1}".' , url , hashPrefix ) ; } parseAppUrl ( withoutHashUrl , this , appBase ) ; this . $$path = removeWindowsDriveName ( this . $$path , withoutHashUrl , appBase ) ; this . $$compose ( ) ; /*
     * In Windows, on an anchor node on documents loaded from
     * the filesystem, the browser will return a pathname
     * prefixed with the drive name ('/C:/path') when a
     * pathname without a drive is set:
     *  * a.setAttribute('href', '/foo')
     *   * a.pathname === '/C:/foo' //true
     *
     * Inside of Angular, we're always using pathnames that
     * do not include drive names for routing.
     */ function removeWindowsDriveName ( path , url , base ) { /*
      Matches paths for file protocol on windows,
      such as /C:/foo/bar, and captures only /foo/bar.
      */ var windowsFilePathExp = / ^\/[A-Z]:(\/.*) / ; var firstPathSegmentMatch ; //Get the relative path from the input URL. if ( url . indexOf ( base ) === 0 ) { url = url . replace ( base , '' ) ; } // The input URL intentionally contains a first path segment that ends with a colon. if ( windowsFilePathExp . exec ( url ) ) { return path ; } firstPathSegmentMatch = windowsFilePathExp . exec ( path ) ; return firstPathSegmentMatch ? firstPathSegmentMatch [ 1 ] : path ; } } ; /**
   * Compose hashbang url and update `absUrl` property
   * @private
   */ this . $$compose = function ( ) { var search = toKeyValue ( this . $$search ) , hash = this . $$hash ? '#' + encodeUriSegment ( this . $$hash ) : '' ; this . $$url = encodePath ( this . $$path ) + ( search ? '?' + search : '' ) + hash ; this . $$absUrl = appBase + ( this . $$url ? hashPrefix + this . $$url : '' ) ; } ; this . $$rewrite = function ( url ) { if ( stripHash ( appBase ) == stripHash ( url ) ) { return url ; } } ; }
LocationHashbangUrl represents url
This object is exposed as $location service when developer doesn't opt into html5 mode.
It also serves as the base class for html5 mode fallback on legacy browsers.

@constructor
@param {string} appBase application base URL
@param {string} hashPrefix hashbang prefix
LocationHashbangUrl represents url This object is exposed as $location service when developer doesn t opt into html5 mode . It also serves as the base class for html5 mode fallback on legacy browsers .