-
Notifications
You must be signed in to change notification settings - Fork 3k
Add option to preserve slashes when generating URLs in reverse routing #329
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
Comments
I would stick with the workaround for now. On the horizon, we have plans for configurable typed parameters where you have full control of forward and reverse conversion. |
Got it. I actually spoke too soon about the workaround. Because |
I'm pretty sure |
OK got it. Re: parseStateRef, I mean you couldn't have a filter that takes the ui-sref expr as input. |
Oh, gotcha. Yeah, in that case what I would do is something like this: <a ui-sref="my.state(filter(params))">click</a> Where Not sure if that solves your use case or if you need a post-processor hook, but it sounds like you've got an interim solution worked out anyway. |
Yup, thanks! I actually just hackily patched it for now. I'll follow the other issue. P.s. UI-router is awesome. |
+1 |
Suppose I have a state with a URL route like
/foo/{bar:.+}
, wherebar
is expected to contain (unescaped) slashes. Then if I use reverse routing to generate a URL whenbar
contains slashes, I get a URL like/foo/bar%2Fbaz%2Fqux
.I can think of 2 solutions:
UriMatchers.prototype.format
does not callencodeURIComponent
on them)..+
that can contain slashes, and don't escape slashes in those. (But what about other special characters?)There is always the workaround of using an AngularJS filter to
s/%2F/\//g
, so this is not an especially urgent problem.The text was updated successfully, but these errors were encountered: