Skip to content

URL with type defined doesn't load any state #1394

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

Closed
ondrowan opened this issue Sep 23, 2014 · 7 comments
Closed

URL with type defined doesn't load any state #1394

ondrowan opened this issue Sep 23, 2014 · 7 comments
Assignees
Labels
Milestone

Comments

@ondrowan
Copy link

Plunk: http://plnkr.co/edit/nlhskp?p=preview

To reproduce, you'll need to download this plunk.

User detail url is defined as /users/{id:int}/. If I browse through links, everything works great. If I try to access link with {...:int} (eg.: plunk/index.html#/users/3/) straight away, no state loads.

If I remove type from URL (/users/{id}/), everything works ok again.

@ProLoser
Copy link
Member

I don't know where you think {...:int} is supposed to work because this is most definitely not a regex. I can't find anything about it in the docs either.

It works perfectly fine with the proper regex: {id:[0-9]+}

@ondrowan
Copy link
Author

I don't think you've followed release 0.2.11, opened plunk I've provided or even read this issue.

Type support was added in this release and it's demonstrated in my plunk. My issue isn't with {id:int} not working at all, but just in specific scenario when you refresh page with URL defined this way (sref links from other states work correctly).

@ProLoser
Copy link
Member

I saw your plunker and reproduced your bug. But when I referred to the docs I found nothing on type support.

@ProLoser ProLoser reopened this Sep 24, 2014
@christopherthielen
Copy link
Contributor

http://angular-ui.github.io/ui-router/site/#/api/ui.router.util.type:Type

I'm not sure how complete the docs are at the moment. I haven't even tried out the new type system yet.

@ProLoser
Copy link
Member

@christopherthielen I'm not sure why you guys even implemented it. I would think patterns are far more powerful. Seems like a step back and just another feature that requires maintenance (as illustrated by this issue).

@christopherthielen
Copy link
Contributor

@ProLoser patterns? like regexp? I don't follow...

There's some discussion about Typed/optional params in Nates PR over at #1032

@christopherthielen
Copy link
Contributor

Fix should be coming soon.

http://plnkr.co/edit/je5VYw?p=preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants