Skip to content

Commit 3984f9b

Browse files
fix($stateChangeSuccess): fire polyfill $stateChangeSuccess right after global state are updated
Closes #3144
1 parent eb7009a commit 3984f9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ng1/legacy/stateEvents.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ export var $stateNotFound: IAngularEvent;
182182
return false;
183183
}
184184

185-
$transition$.promise.then(function () {
185+
// right after global state is updated
186+
let successOpts = { priority: 9999 };
187+
$transition$.onSuccess({}, function () {
186188
$rootScope.$broadcast('$stateChangeSuccess', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
187-
});
189+
}, successOpts);
188190
}
189191

190192
if (enabledEvents.$stateChangeError) {

0 commit comments

Comments
 (0)