Skip to content

ui-sref not correctly setting href attribute with angular 1.3 #1408

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

Closed
theJoeBiz opened this issue Sep 26, 2014 · 3 comments
Closed

ui-sref not correctly setting href attribute with angular 1.3 #1408

theJoeBiz opened this issue Sep 26, 2014 · 3 comments

Comments

@theJoeBiz
Copy link
Contributor

I've been building an app with the angular 1.3 release candidate and another one of my team members mentioned that when right clicking and opening in a new tab it wasn't maintaining the html5Mode(off) hashbang.

Example:

<a ui-sref="home"></a>

should resolve to

<a href="#/home"></a>

but instead it's resolving to

<a href="/home"></a>

This is only happening with angular 1.3.x.

So I looked into it and believe I found the issue.

Previous to angular 1.3.x, $locationProvider.html5Mode() used to simply return a boolean. Now, it returns an object like so:

{
  enabled: false,
  requireBase: true
}

I'll make a pull request, but just wanted the issue documented.

Oh, here's a plunker. Try to right click and open in a new window/tab and you'll receive a broken page because the hash is missing.

@christopherthielen
Copy link
Contributor

Hi @theJoeBiz Thanks for the detailed issue report. This is dupe #1397 and we just merged the fix in #1404

@theJoeBiz
Copy link
Contributor Author

Woops! Was just coming back to close this because I realized my fork was out of date.

@christopherthielen
Copy link
Contributor

👍 appreciate the effort

cmcnamara87 added a commit to Bio-LarK/orpha that referenced this issue Nov 4, 2014
Closes #82

Updated ui-router to pre-release to fix the problem with angular 1.3
and missing. In the current release, ui-router is stuck in html5 mode,
even if it is currently disabled.
angular-ui/ui-router#1408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants