angular / router

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

[Angular2] router-link needs router-params #312

Closed cexbrayat closed 9 years ago

cexbrayat commented 9 years ago

@btford I assume you prefer the issue in this repo even the code is in the Angular2 repo for now?

I have this template

<a router-link="login">Login</a>

And the navigation won't work if I don't add route-params, even if I don't need it:

<a router-link="login" router-params="">Login</a>

It looks like because the method updateHref is waiting for both attributes to be set:

in router-link.js:

if (isPresent(this._route) && isPresent(this._params)) {
  var newHref = this._router.generate(this._route, this._params);
  DOM.setAttribute(this._domEl, 'href', newHref);
}

I would gladly submit a PR, but I'm not sure what would be the proper way to fix it...

cexbrayat commented 9 years ago

Looks like it will be fixed by https://github.com/angular/angular/commit/77d1fc149a0eb34bc872b8444c763bd05466f53c