RouterLink has not(a) selector but it works on <a> tags

This issue has been tracked since 2022-09-22.

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?



Both the documentation and router/src/directives/router_link.ts show:

  selector: ':not(a):not(area)[routerLink]',

However demos in documentation (and so far popular practice) has been using it on anchors like

<a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge">

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

tomasdev wrote this answer on 2022-09-22

Not to confuse RouterLink with RouterLinkWithHref

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-10-05
Star Count 84152
Watcher Count 3063
Fork Count 22247
Issue Count 1203


Issue Title Created Date Updated Date