Skip to content

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

Closed
@emilbayes

Description

@emilbayes

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions