-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The params option in state configurations doesn't handle well deep objects #1562
Comments
Sounds like a bug. Can you put this in a plunk? |
Here is a minimal testcase for the bug where my "complex" $stateParams will be encoded into a string: http://plnkr.co/edit/lwMGRoyJJkJLu5bXohYD?p=preview Obviously this bug will mostly happen to people using the Still I am not sure if params that aren't URL paths should appear as query string? Is it expected or another bug if I end up having URLs like |
Is the following behavior what you would expect? I added an "any" type for parameters which don't encode or decode, it just passes the value. I made this the default type for "config" parameters, i.e., non-url parameters. I'm going to have to dig in a little deeper to figure out why your params showed up as a query parameter. That was quite unexpected. Somehow changing to "any" type seems to have resolved that. |
Yes, this behaviour looks correct, thanks. Just to make it clearer, I forked your plunk to add urls-parameters to the protected page (I should have done that in the first place), so that |
From what I can see, the fact that params options show up as a query parameter is not happening with the version 0.2.11 but is with 0.2.12. |
should be fixed today |
I may be using the
params
options when configuring a state for an unexpected scenario.I have a login page defined like this:
I used params because I want to pass information to the login page (like why someone would end up being redirected to that page and where to go next once successfully logged in) without "polluting" the URL.
If an auth error happen I used the following code:
With ui-router 0.2.12 I see two issues:
LoginCtrl
,$stateParams.toParams
equals the string "[object Object]" instead of being thetoParams
object from before. Is that an expected behavior or a bug?The text was updated successfully, but these errors were encountered: