Skip to content

Commit 6815946

Browse files
committed
fix($location): $locationchangesuccess not fires with browser back when path ends with '/#'. angular#12175
1 parent 9e6a9b9 commit 6815946

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ng/location.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,12 @@ function $LocationProvider() {
922922
$location.$$parse(newUrl);
923923
$location.$$state = newState;
924924

925-
defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
925+
defaultPrevented = $rootScope.$broadcast('$locationChangeStart', trimEmptyHash(newUrl), oldUrl,
926926
newState, oldState).defaultPrevented;
927927

928928
// if the location was changed by a `$locationChangeStart` handler then stop
929929
// processing this location change
930-
if ($location.absUrl() !== newUrl) return;
930+
if ($location.absUrl() !== trimEmptyHash(newUrl)) return;
931931

932932
if (defaultPrevented) {
933933
$location.$$parse(oldUrl);

0 commit comments

Comments
 (0)