Permalink
Browse files

fix($stateChangeSuccess): fire polyfill `$stateChangeSuccess` right a…

…fter global state are updated

Closes #3144
  • Loading branch information...
1 parent eb7009a commit 3984f9b6f31a1d1d62f5eab150cc8371629432a8 @christopherthielen christopherthielen committed Nov 10, 2016
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/ng1/legacy/stateEvents.ts
@@ -182,9 +182,11 @@ export var $stateNotFound: IAngularEvent;
return false;
}
- $transition$.promise.then(function () {
+ // right after global state is updated
+ let successOpts = { priority: 9999 };
+ $transition$.onSuccess({}, function () {
$rootScope.$broadcast('$stateChangeSuccess', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
- });
+ }, successOpts);
}
if (enabledEvents.$stateChangeError) {

0 comments on commit 3984f9b

Please sign in to comment.