I ran into the same problem. I suppose this could be due to two things: 1. $ stateParams does not exist at the time of the call 2. $ stateParams are not tied to the caller.
Anyway, I solved this problem as follows:
.run(['$rootScope', function ($rootScope) {
$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
$rootScope.toParams = toParams;
});
}])
and use $ rootScope.toParams in my object:
params: {
page: $rootScope.toParams.page,
}
source
share