How to Get A Route Parameter for Resolve ?
I'm trying to get the route parameter for resolve, but $state.current.params, $state.params, $stateParams are all empty. But in ng-router, I can get it by using $route.current.params.
+1
At the point at which resolves are triggered, the global state hasn't been updated because the transition is pending and could still fail. If that happens, everything needs to be rolled back so that the UI is left in a consistent state.
Keep in mind, injecting $stateParams is 'magical', such that your resolves will only get the parameters for the state on which it is defined, as well as any parent states.
We're working on an API which will allow resolves to access all details of the transition, which is due out shortly. Stay tuned. In the meantime, I'd suggest posting a plunkr of your issue and taking it to StackOverflow, where the community can help you debug it. Thanks.
+1