Reputation: 1515
I have a, tag, with href. I don't want to change the URL when this link is clicked but still traverse to where it should be. I saw that we can use skipLocationChange, but not working. Any alternatives suggested.
In my html:
<a href="#/temp" skipLocationChange>linkitem</a>
Upvotes: 2
Views: 2115
Reputation: 6844
You need to use the [routerLink]
directive to access that property
<a [routerLink]="['/temp']" skipLocationChange>linkitem</a>
Upvotes: 3