diff options
Diffstat (limited to 'src/ng/location.js')
| -rw-r--r-- | src/ng/location.js | 16 | 
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ng/location.js b/src/ng/location.js index 6ec7d337..f06a5f81 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -22,8 +22,8 @@ function encodePath(path) {    return segments.join('/');  } -function parseAbsoluteUrl(absoluteUrl, locationObj) { -  var parsedUrl = urlResolve(absoluteUrl); +function parseAbsoluteUrl(absoluteUrl, locationObj, appBase) { +  var parsedUrl = urlResolve(absoluteUrl, appBase);    locationObj.$$protocol = parsedUrl.protocol;    locationObj.$$host = parsedUrl.hostname; @@ -31,12 +31,12 @@ function parseAbsoluteUrl(absoluteUrl, locationObj) {  } -function parseAppUrl(relativeUrl, locationObj) { +function parseAppUrl(relativeUrl, locationObj, appBase) {    var prefixed = (relativeUrl.charAt(0) !== '/');    if (prefixed) {      relativeUrl = '/' + relativeUrl;    } -  var match = urlResolve(relativeUrl); +  var match = urlResolve(relativeUrl, appBase);    locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?        match.pathname.substring(1) : match.pathname);    locationObj.$$search = parseKeyValue(match.search); @@ -91,7 +91,7 @@ function LocationHtml5Url(appBase, basePrefix) {    this.$$html5 = true;    basePrefix = basePrefix || '';    var appBaseNoFile = stripFile(appBase); -  parseAbsoluteUrl(appBase, this); +  parseAbsoluteUrl(appBase, this, appBase);    /** @@ -106,7 +106,7 @@ function LocationHtml5Url(appBase, basePrefix) {            appBaseNoFile);      } -    parseAppUrl(pathUrl, this); +    parseAppUrl(pathUrl, this, appBase);      if (!this.$$path) {        this.$$path = '/'; @@ -158,7 +158,7 @@ function LocationHtml5Url(appBase, basePrefix) {  function LocationHashbangUrl(appBase, hashPrefix) {    var appBaseNoFile = stripFile(appBase); -  parseAbsoluteUrl(appBase, this); +  parseAbsoluteUrl(appBase, this, appBase);    /** @@ -178,7 +178,7 @@ function LocationHashbangUrl(appBase, hashPrefix) {        throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url,            hashPrefix);      } -    parseAppUrl(withoutHashUrl, this); +    parseAppUrl(withoutHashUrl, this, appBase);      this.$$compose();    };  | 
