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

$routeProvider - optional named group + trailing slash #9742

Closed
jirikuchta opened this issue Oct 22, 2014 · 7 comments
Closed

$routeProvider - optional named group + trailing slash #9742

jirikuchta opened this issue Oct 22, 2014 · 7 comments

Comments

@jirikuchta
Copy link

From $routeProvider documentation:

If $location.path contains redundant trailing slash or is missing one, the route will still match and the $location.path will be updated to add or drop the trailing slash to exactly match the route definition.

It seems this does not work as expected if there is an optional named group in route path definition (e.g. /page/:name?). In that case an encoded question mark will appear in the URL if you will navigate to /page/index/ (notice the trailing slash at the end).

You can test this issue in this plunkr.

@Narretz
Copy link
Contributor

Narretz commented Oct 22, 2014

Seems to be the same issue as in #8200

But I'll keep it open in case the PR gets closed or anything.

@gkalpak
Copy link
Member

gkalpak commented Nov 23, 2014

This has been fixed in 1.3.x. by #9827.
Do we want to backport the fix to 1.2.x ?

@pkozlowski-opensource
Copy link
Member

@gkalpak I think it makes sense to back-port it to 1.2.x. Would you be up to a PR?

@gkalpak
Copy link
Member

gkalpak commented Nov 23, 2014

@pkozlowski-opensource: Working on it.

@pkozlowski-opensource
Copy link
Member

awesome 👍

@gkalpak
Copy link
Member

gkalpak commented Nov 23, 2014

Backporting the fix to v1.2.x: #10202
/ping @pkozlowski-opensource

@pkozlowski-opensource
Copy link
Member

Landed as 1b9e408, thnx!

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

No branches or pull requests

4 participants