Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

$route should allow regexps params #918

Closed
vojtajina opened this Issue · 11 comments
@vojtajina

things like: /some/:param ([0-9]*)

or allow list of values, eg. /some/:param where param can be one of ['one', 'two', 'three']

Check out server side frameworks and their routing.

@zygimantas

I would recommend /some/<param:[0-9]*> pattern.

@blainegarrett

+1
Additionally, I'd like to be able to include slashes as valid strings in the match. This appears not to work currently.

@lrlopez

@blainegarrett, you should have a look into PR #1560 as it allows matching arbitrary strings which also include slashes.

@xealot xealot referenced this issue from a commit
@xealot xealot This generally improves Angular routes in a backwards compatible way.
Addresses:
- A TODO where most routes was being compiled and processed every single route change. Routes are now processed up front and simply matched

- Routes are now processed in the order in which they are added instead of arbitrarily.

- Helps with #1147
- Helps with #1159
- Makes #918 easier

- It is now possible to match the forwardslash character.

- It is now possible to restrict your match to string, int or path.
872eed7
@petrovalex

@blainegarrett I was able to include slashes as valid string in my implementation just by extending the $routeProvider.shortcuts with { "path": { regex: "[\\w\\/]+" } } and then specifying the constraint for the parameter to be path. actually, I have exposed this shortcuts object, so that it is configurable from outside

@lucsky

+1

@rzajac

+1

@lrlopez lrlopez referenced this issue in angular-ui/ui-router
Closed

Enhanced route syntax #5

0 of 4 tasks complete
@atian25

when will this merge to master?

@btford btford closed this
@btford
Owner

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.