angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

ng-link not evaluated for other elements than a (should work like ng-click) #375

Open offboarded-x233534 opened 9 years ago

offboarded-x233534 commented 9 years ago

I want the ng-link attribute to work with any other html element such as li, span.

Right now it really only seems to work with a element. But it should work the same way as ng-click on any html element.

:white_check_mark: works:

<a ng-link="myComponent">foo</a>

:no_entry_sign:does not work e.g. for a li-element:

<ul ng-repeat="foo in foos">
  <li ng-link="myComponent({fooId: foo.id})">
    {{foo.name}} ... other foo stuff
  </li>
</ul>
0x-r4bbit commented 9 years ago

Hi. As stated in the README, this repository is currently on hold, since the development is happening over at http://github.com/angular/angular. Please use the router for A1 from there and verify if this is still an issue.

Thanks!

0x-r4bbit commented 8 years ago

I'd also like to add that semantically, in most of the cases you're navigating to a component with a URL associated to it. If this is the case, you wan to use an anchor tag anyways, since [router-link] generates an href for you.