-
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
Parameter Typing -- URL Only #454
Conversation
…$stateChangeSuccess
… params and known types. Exec will run any found types through the decode function
$resolve now correctly executes factory functions when provided the name of the factory as a string. Closes angular-ui#449
@@ -107,6 +107,13 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ | |||
$delegates: {} | |||
}; | |||
|
|||
// Create a proxy through to the Type registration on the UrlMatcherFactory | |||
this.isTypeRegistered = $urlMatcherFactory.isTypeRegistered; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be better to make type()
a getter if you only pass a name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but instead, I've just dropped it. I only needed it for test purposes, and the exposed type
function has to return the state
object so that the config can be chained.
So, it's looking like you're on the right track so far. In the issue thread you mentioned something about Let me know if you have any other questions, but barring the one note I left, it looks good to me. |
Aren't we still missing a way to check the type before considering it a match or am I missing that? I don't see a test for it either. Also in the Sample you added a custom date type but I don't think it's used in any urls, if it's not, we should add an example or not use it. We shouldn't have any extraneous code in the sample. Also you changed a param in the sample from regex to integer but you didn't change the comment above it which still talks about regex usage. |
I showed how to do it in the issue thread.
It's still a work-in-progress, he was just checking in. |
…t-support Component support
How's the status of this? |
+1 |
I'm having an issue where I want to include the contents of my search input box in the route as a param, like so:
...but if the user types a slash, then it adds that slash to my URL, which routes me to a new location. I want the slash to be encoded, but if I manually encode it myself to %2F, ui-router then encodes the % so the result is %252F. I just want to be able to tell ui-router to encode (and decode when appropriate) the slash as well. My understanding is that this patch will allow me to do that. If that's correct, here's my +1! |
Btw everyone, here's the current status of this feature: https://github.com/angular-ui/ui-router/commits/types @iangilman Feel free to submit an issue with a Plunkr that demonstrates the problem, or a PR with a unit test. |
@nateabele Thank you for the update! I'm not confident in my ability to boil the issue down to a Plunkr, but I'll post here if I make it happen. |
This has been implemented. |
Awesome :-) |
Is it time to release v.2.11, then? =) |
Can someone point to the docs for this? I can't find anything for where parameter typing is :( |
I'm a bit concerned I'm not going down the right path here, so I'd love some feedback on this before I go farther. With this code, you can add types which will be encoded/decoded as they pass back and forth to the URL. Everything is handled with the URL property right now, no params structure.