angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.54k stars 3k forks source link

Issue with #!/ url in enabled html5mode, it is changing URL to #!/%2F #3362

Closed andywunderlich closed 7 years ago

andywunderlich commented 7 years ago

This issue tracker is for Bug Reports and Feature Requests only. Please direct requests for help to StackOverflow. See http://bit.ly/UIR-SOF for details.

This is a:

My version of UI-Router is: 1.0.0-rc.1

Bug Report

Current Behavior:

I have the router configuration: $locationProvider.html5Mode(true).hashPrefix('!');

And i want to use Snipcart. By click on Add to cart, Snipcart is adding #!/cart to the url. Angular UI Router is changing the url to #!%2Fcart which issues that the cart is not displayed.

Example: http://localhost:333/product

By click to Add to cart the url is changing to http://localhost:333/product#!%2Fcart

Expected Behavior:

I expect that the url will be http://localhost:333/product#!/cart

With disabled Html5Mode it works correctly, but i don't want to need the # in every url. I also tried already a lot of different modes, like:

$locationProvider.html5Mode(false).hashPrefix(''); $locationProvider.html5Mode(true).hashPrefix(''); $urlMatcherFactoryProvider.strictMode(false);

I see no reason why angular ui router should change the / to %2F after the hashtag #!

Thanks, Andy

christopherthielen commented 7 years ago

Please provide a plunker reproduction. http://bit.ly/UIR-Plunk1

When you have provided a plunker, re-open this issue.

craig-doyle-uk commented 6 years ago

@andywunderlich - how did you resolve this issue? I have exactly the same behaviour in an app that I am adding the cart to.