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
$stateParams array value is converted to string when single element #2979
Comments
Is it in a query parameter? If so, force the 'array mode' to true: https://ui-router.github.io/docs/latest/interfaces/params.paramdeclaration.html#array Can you show me the |
Closing due to no activity |
It's well work for me. But if use [] in place new Array() array can be cast to a string url: 'posts?s&tags&page',
params: { s: null, tags: new Array(), page: null },
templateUrl: "/static/templates/posts/posts.html", |
I'm seeing the same behavior, works with more than one array member, but an Array of length 1 or less isn't an array, but a single value. Using the alternate syntax ?kind[]=example would work here
|
When calling $state.go('app.foo', {someArray: ['a']}), the $stateParams.someArray is received as 'a'. When there are multiple values, it is received correctly as an array. This makes consistent processing difficult.
The text was updated successfully, but these errors were encountered: