I upgraded ui-router v0.2 to 1.0.0, but I have some problems with my existing code. Therefore, I read in official documents that
$rootScope.$on('$stateChangeStart'
now replaced by $transitions.onStart({},
same $rootScope.$on('$stateChangeSuccess'with$transitions.onSuccess({},
So far so good. But in my source code, I have the following:
$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
$state.go(toState.name, toParams);
}
I tried the following:
$transitions.onStart({}, function (toState, toParams) {
$state.go(toState, toParams);
}
But toStatealso toParamsinaccessible ... I looked at the documents, but I canβt understand what should I do here. Any help would be appreciated. Thank.
source
share