Skip to content

ui-sref does not set href when url is empty string #1293

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
emilbayes opened this issue Aug 26, 2014 · 2 comments
Closed

ui-sref does not set href when url is empty string #1293

emilbayes opened this issue Aug 26, 2014 · 2 comments
Assignees
Labels

Comments

@emilbayes
Copy link

Example JS:

$stateProvider
      .state('frontpage', {
         url: '^',
         templateUrl: '/js/templates/frontpage.html'
      })
      .state('news', {
         url: '/news',
         templateUrl: '/js/templates/news.html'
      })

Example HTML:

<a ui-sref="frontpage">Frontpage</a>
<a ui-sref="news">News</a>

Rendered HTML:

<a ui-sref="frontpage">Frontpage</a>
<a ui-sref="news" href="/news">News</a>

The first <a> is missing the href="" attribute, however the click event is bound, so this should be an easy fix. I'd be happy to submit a PR, but there seems to be a long lead time on reviews/merges.

@christopherthielen
Copy link
Contributor

What happens when url: ''?

@emilbayes
Copy link
Author

Same as above, no href

@christopherthielen christopherthielen self-assigned this Aug 26, 2014
christopherthielen added a commit that referenced this issue Aug 27, 2014
fix(uiSref): Generate an href for states with a blank url. closes #1293
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants