diff options
| author | Misko Hevery | 2013-05-02 18:22:03 -0400 |
|---|---|---|
| committer | Misko Hevery | 2013-05-02 18:22:03 -0400 |
| commit | a348e90aa141921b914f87ec930cd6ebf481a446 (patch) | |
| tree | e3f7e7be0aecf27840ee7378ff76ef744733943b /src | |
| parent | 4bd7bedf48c0c1ebb62f6bd8c85e8ea00f94502b (diff) | |
| download | angular.js-a348e90aa141921b914f87ec930cd6ebf481a446.tar.bz2 | |
fix($location): compare against actual instead of current URL
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/location.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ng/location.js b/src/ng/location.js index 1a7f4208..4c31d0ad 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -128,7 +128,7 @@ function LocationHtml5Url(appBase, basePrefix) { } else { return appBase + prevAppUrl; } - } else if ( (appUrl = beginsWith(appBaseNoFile, url)) ) { + } else if ( (appUrl = beginsWith(appBaseNoFile, url)) !== undefined ) { return appBaseNoFile + appUrl; } else if (appBaseNoFile == url + '/') { return appBaseNoFile; @@ -524,12 +524,12 @@ function $LocationProvider(){ if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; } - var absHref = elm.prop('href'), - rewrittenUrl = $location.$$rewrite(absHref); + var absHref = elm.prop('href'); + var rewrittenUrl = $location.$$rewrite(absHref); if (absHref && !elm.attr('target') && rewrittenUrl) { event.preventDefault(); - if (rewrittenUrl != initialUrl) { + if (rewrittenUrl != $browser.url()) { // update location manually $location.$$parse(rewrittenUrl); $rootScope.$apply(); |
