Skip to content

Commit d557cfc

Browse files
committed
Re-added the saved hash earlier (issues with libraries listening on $stateChangeStart)
Re-added the saved hash before broadcasting $stateChangeStart. This way, libraries using this event to do their magic will have the hash accessible through toParams. (e.g. https://github.com/Narzerus/angular-permission)
1 parent d31b333 commit d557cfc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/state.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,10 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
10481048

10491049
// Filter parameters before we pass them to event handlers etc.
10501050
toParams = filterByKeys(to.params.$$keys(), toParams || {});
1051-
1051+
1052+
// Re-add the saved hash before we start returning things or broadcasting $stateChangeStart
1053+
if (hash) toParams['#'] = hash;
1054+
10521055
// Broadcast start event and cancel the transition if requested
10531056
if (options.notify) {
10541057
/**
@@ -1126,9 +1129,6 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
11261129
}
11271130
}
11281131

1129-
// Re-add the saved hash before we start returning things
1130-
if (hash) toParams['#'] = hash;
1131-
11321132
// Run it again, to catch any transitions in callbacks
11331133
if ($state.transition !== transition) return TransitionSuperseded;
11341134

0 commit comments

Comments
 (0)