You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.
Dear All,
I can see that when we trigger a navigation to a root state A and DSR towards its child status B is enabled, the initial navigation to A is not "fully stopped" but for some reason it continues even if redirection to B has been trigger.
I believe the problem is at the end of this callback:
`$rootScope.$on("$stateChangeStart", function (event, toState, toParams, fromState, fromParams) {
var cfg = getConfig(toState);
if (ignoreDsr || (computeDeepStateStatus(toState) !== REDIRECT) && !cfg['default']) return;
// We're changing directly to one of the redirect (tab) states.
// Get the DSR key for this state by calculating the DSRParams option
var key = getParamsString(toParams, cfg.params);
var redirect = lastSubstate[toState.name][key] || cfg['default'];
if (!redirect) return;
// we have a last substate recorded
var $dsr$ = { redirect: { state: redirect.state, params: redirect.params}, to: { state: toState.name, params: toParams } };
var result = $injector.invoke(cfg.fn, toState, { $dsr$: $dsr$ });
if (!result) return;
if (result.state) redirect = result;
event.preventDefault();
var redirectParams = getMatchParams(toParams, cfg.params);
**setTimeout(function () { $state.go(redirect.state, angular.extend(redirectParams, redirect.params)); }, 100)**
});`
if I set a timeout on calling the redirection, the initial navigation is correctly stopped and the redirection correctly happend after it.
Can anybody advise? Can we push this change?
Thanks everybody
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Dear All,
I can see that when we trigger a navigation to a root state A and DSR towards its child status B is enabled, the initial navigation to A is not "fully stopped" but for some reason it continues even if redirection to B has been trigger.
I believe the problem is at the end of this callback:
`$rootScope.$on("$stateChangeStart", function (event, toState, toParams, fromState, fromParams) {
var cfg = getConfig(toState);
if (ignoreDsr || (computeDeepStateStatus(toState) !== REDIRECT) && !cfg['default']) return;
// We're changing directly to one of the redirect (tab) states.
// Get the DSR key for this state by calculating the DSRParams option
var key = getParamsString(toParams, cfg.params);
var redirect = lastSubstate[toState.name][key] || cfg['default'];
if (!redirect) return;
});`
if I set a timeout on calling the redirection, the initial navigation is correctly stopped and the redirection correctly happend after it.
Can anybody advise? Can we push this change?
Thanks everybody
The text was updated successfully, but these errors were encountered: