Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$route.when('/route' should also resolve '/route/' #784

Closed
edwardhotchkiss opened this issue Mar 12, 2012 · 3 comments
Closed

$route.when('/route' should also resolve '/route/' #784

edwardhotchkiss opened this issue Mar 12, 2012 · 3 comments
Assignees

Comments

@edwardhotchkiss
Copy link

For a GET this is a pretty standard pattern. It's also a lovely aesthetic, with leaving off a trailing slash being a legacy/common trait on a static file -- /index.html, /route/some/item/item5.html.

ATM I'm using:

$route.when('/user', {
  redirectTo : '/user/login'
});

$route.when('/user/', {
  redirectTo : '/user/login'
});

I could work a pull request up if you guys were interested, otherwise keep on using my helper fn.

  • Edward Hotchkiss
@mhevery
Copy link
Contributor

mhevery commented Mar 13, 2012

Sure, PR would be welcomed

IgorMinar added a commit to IgorMinar/angular.js that referenced this issue Mar 20, 2012
This makes for a much more flexible route matching:

- route /foo matches /foo as well as /foo/
- route /bar/ matches /bar/ as well as /bar

Closes angular#784
@ghost ghost assigned IgorMinar Mar 20, 2012
@IgorMinar
Copy link
Contributor

I took care of this

@edwardhotchkiss
Copy link
Author

Sweet! :P

vojtajina pushed a commit to vojtajina/angular.js that referenced this issue Mar 20, 2012
This makes for a much more flexible route matching:

- route /foo matches /foo and redirects /foo/ to /foo
- route /bar/ matches /bar/ and redirects /bar to /bar/

Closes angular#784
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants