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

Slash is not removed for squash:true when optional param terminates the url #1902

Closed
JakobJingleheimer opened this issue Apr 21, 2015 · 6 comments

Comments

@JakobJingleheimer
Copy link
Contributor

In @christopherthielen's plunkr example from #1501, :username's slash is not removed when it is squashed. The documented behaviour for squash: true is that the optional parameter plus a slash are removed.

Reprod:

  1. Open the plunkr
  2. Click on the purple user({username: 'christopherthielen'}) button.

Observed output: /user/
Expect output: /user

@christopherthielen christopherthielen self-assigned this Apr 21, 2015
@cmmcleod
Copy link

+1

@christopherthielen
Copy link
Contributor

The parameter's default value is omitted from the URL. If the parameter is preceeded and followed by slashes in the state's url declaration, then one of those slashes are omitted.

I think what you're seeing is correct behavior. According to the docs, only one of two slashes is omitted.

@christopherthielen christopherthielen removed their assignment May 20, 2015
@hworld
Copy link

hworld commented Jun 18, 2015

Is it hard to make a setting to clean/trim the end of the URL with squashed params? It's frustrating when all your URLs are consistent with no trailing slash and then you hit one url with a trailing slash because it has a squashed parameter.

@JakobJingleheimer
Copy link
Contributor Author

@christopherthielen in my reprod steps, none are removed:

false: '/user/christopherthielen',
// …
true: '/user/'

the slash preceding christopherthielen is not removed. It should be.

@JakobJingleheimer
Copy link
Contributor Author

bump.

Is anyone looking into this? If not, could someone point me to where this is in the code base and I'll take a stab at it.

@deepakpookkote
Copy link

@jshado1 :Hi, How to handle this issue ? i'm facing this issue right now in my development. how to remove trailing slashes in ui-sref using squash!

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

No branches or pull requests

6 participants