Skip to content
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

Impossible to configure similar routes #132

Open
thorn0 opened this issue Jun 13, 2015 · 1 comment
Open

Impossible to configure similar routes #132

thorn0 opened this issue Jun 13, 2015 · 1 comment

Comments

@thorn0
Copy link
Contributor

thorn0 commented Jun 13, 2015

Let's try to configure two routes:

  1. {regex(^\w+$):foo}/{regex(^\d+$):bar}
  2. {regex(^\w+$):foo}/{regex(^[a-z]+$):bar}

The only difference between them is inside the second regex. If we try to open a URL that matches the first route, we'll see that this route can't be found. If we look into $route.routes in the console, we'll see something like:

▶ /$0:regex/$1:regex: Object
▶ null: Object

Only one entry instead of two.

@jeme
Copy link
Contributor

jeme commented Jun 17, 2015

that would be around here that something needs to change:

https://github.com/dotJEM/angular-routing/blob/master/src/route.ts#L357

The normalization is intentional, so /route/:a and /route/:b won't generate two routes where the second never will be used as they match the same thing.

That said, when it comes to parameters with converters, the arguments ofc. needs to be accounted for. I don't have much time these days as I have so many other things to work on, but feel free to propose a solution.

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

No branches or pull requests

2 participants