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
This is one of my diversions from ui-router behavior that I regret.
Right now, you can pass whatever parameters into stateRouter.go or stateRouter.makePath and they will get put into the url and show up on the parameters object, even if no state depends on them.
I think that if you attempt to create a route, or if you try to navigate to a route, and you use any parameters that are not used by any of the states at the route you're going to, then those parameters should just be dropped and shouldn't show up in the url.
This could be accomplished with only a feature bump if a new option was added to stateRouter initialization, something like allowParametersNotUsedByAnyState or whatever. It could default to true (the current behavior).
Eventually, we could log a deprecation warning when that value was true, and eventually eventually we could flip the default to false.
Any thoughts?
The text was updated successfully, but these errors were encountered:
But that's the only thing I could see someone currently relying on, as the parameters aren't actually passed into activate/resolve if they're not defined in the state's parameter list.
A more backwards-compatible way to do this would also be to leave the unused parameters in the URL, but not pass the values to the resolve/activate functions.
This is one of my diversions from ui-router behavior that I regret.
Right now, you can pass whatever parameters into
stateRouter.go
orstateRouter.makePath
and they will get put into the url and show up on the parameters object, even if no state depends on them.I think that if you attempt to create a route, or if you try to navigate to a route, and you use any parameters that are not used by any of the states at the route you're going to, then those parameters should just be dropped and shouldn't show up in the url.
This could be accomplished with only a feature bump if a new option was added to
stateRouter
initialization, something likeallowParametersNotUsedByAnyState
or whatever. It could default totrue
(the current behavior).Eventually, we could log a deprecation warning when that value was
true
, and eventually eventually we could flip the default tofalse
.Any thoughts?
The text was updated successfully, but these errors were encountered: