In my Angular 2 application I\'m trying to disable a routerLink without any success. I\'ve tried to handle the click event on the click
event (with event.
I've just had some success with a similar issue: having an array of nav links in an ngFor, some required [routerLink], while others required (click) - my issue was that all links relied on [routerLink] for [routerLinkActive], so I had to stop routerLink, without touching it's value.
`
`
with:
`click: ($event) => {
$event.stopPropagation(); // Only seems to
$event.preventDefault(); // work with both
// Custom onClick logic
}`
As the span is inside, you can be sure the cancelling of the event happens before it bubbles up to [routerLink], while routerLinkActive will still apply.