Skip to content

Commit

Permalink
fix($stateChangeSuccess): fire polyfill $stateChangeSuccess right a…
Browse files Browse the repository at this point in the history
…fter global state are updated

Closes #3144
  • Loading branch information
christopherthielen committed Nov 10, 2016
1 parent eb7009a commit 3984f9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ng1/legacy/stateEvents.ts
Expand Up @@ -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) {
Expand Down

0 comments on commit 3984f9b

Please sign in to comment.