From a348e90aa141921b914f87ec930cd6ebf481a446 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 2 May 2013 18:22:03 -0400 Subject: fix($location): compare against actual instead of current URL --- src/ng/location.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ng') 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(); -- cgit v1.2.3