This is used by Angular (2+ maybe Angular JS too -not sure of that) to control navigation between UI components. It acts like a Controller/traffic cop, passing state information on via a URL. Here is the official link to the documentation
Questions tagged [routerlink]
312 questions
163
votes
4 answers
Difference between [routerLink] and routerLink
What is the difference between [routerLink] and routerLink ? How should you use each one?

Eslam Tahoon
- 2,205
- 4
- 15
- 21
138
votes
7 answers
How to VueJS router-link active style
My page currently has Navigation.vue component.
I want to make the each navigation hover and active. The hover works but active doesn't.
This is how Navigation.vue file looks like :
95
votes
6 answers
How to use router.navigateByUrl and router.navigate in Angular
https://angular.io/api/router/RouterLink gives a good overview of how to create links that will take the user to a different route in Angular4, however I can't find how to do the same thing programmatically rather needing the user to click a link

Michael
- 1,087
- 1
- 9
- 12
57
votes
11 answers
VueJs vue-router linking an external website
This may be simple, but I've looked over documentation and can't find anything about it. I want to have my 'github' link redirect to say, github.com. However, its just appending 'https://github.com' to my url instead of following the link. Here is a…

nateph
- 1,137
- 2
- 9
- 13
38
votes
10 answers
vue-router : how to remove underline from router-link
This results in an underlined link:
Hello
My understanding is that the router-link element generates an a tag.
I've tried these things in the CSS:
router-link{
text-decoration:…

rpivovar
- 3,150
- 13
- 41
- 79
34
votes
16 answers
How to disable a vuejs router-link?
I have a single-page app that i've created using vue, and the nav links are all done using router-link tags. There are a couple of items in the nav that my boss wants to have in the nav but disabled so that people can get a glimpse of some features…

movac
- 1,576
- 3
- 21
- 45
25
votes
3 answers
Angular 2/4 - routerLinkActive not working properly
I have a problem with my routerLinkActive.
Here is two Gifs to explain.
First problem: When i start the app, none of the routerLinkActive give the class active. But if i click on a different route, that finaly works.
When I click at first on the…

Wandrille
- 6,267
- 3
- 20
- 43
25
votes
4 answers
Router link not working for a component inside a shared module
I have written a module named "Customer" which has several components like login, home and register. Now I have created a shared module which is also having 2 components such as header and footer. Since header and footer are going to be shared by…

Senthil Kumar
- 373
- 1
- 3
- 8
24
votes
5 answers
Angular 7 - Multiple outlets : Error: Cannot activate an already activated outlet
Here is the issue that I'm encountering with Angular 7 :
I have two outlets : the main app router outlet, and a secondary outlet named 'administration'.
When I want to navigate through any administration link at start, it works fine. But next time,…

Anthony Coucke
- 251
- 1
- 2
- 5
19
votes
3 answers
Angular variable into routerLink
I'm trying to pass an id in my routerLink, how could I concatenate it?
doesnt work.
Do you have solutions?
Thanks in advance
user10623427
17
votes
5 answers
Angular - Passing object to @Input parameter with routerlink
I have an angular component with a @Input parameter as follows.
@Component({
selector: 'app-transmission-history'
})
export class TransmissionHistoryComponent implements OnInit {
@Input() theRecord: Record = null;
constructor(private…

Don Chambers
- 3,798
- 9
- 33
- 74
15
votes
1 answer
Angular 4: changing url, but component is not rendered
I'm trying to link a component from one component using routerLink = "selected"
const routes: Routes = [
{
path: '',
children: [
{
path: 'account',
component: AccountComponent,
…

yer
- 1,454
- 2
- 16
- 33
14
votes
4 answers
Border of div bound to routerlink directive?
I have encountered an issue where divs using routerLink get bordered with blue when clicked. I think I am missing something very obvious, possibly even a configuration I have in my browser or some missed css styling, so a polite explanation of the…

David Streid
- 685
- 3
- 12
- 24
13
votes
3 answers
Ionic 4: How to set navigation direction (backward/forward) using routerLink?
Ionic 4 now uses Angular router. Altough it still has its own NavControler, which helps to simulate push / pop navigation style though the navigateBackward and navigateForward methods.
So that ion-back-button is shown it is necessary to use…

Natanael
- 1,326
- 5
- 17
- 34
13
votes
1 answer
Why routerLink and router.navigate() act differently?
When using this code in HTML:
it navigates correctly to '/child/(flow:step1)'!!!
When trying to use this code in Typescript:
this.router.navigate([{ outlets:…

Vladi Isakov
- 289
- 6
- 16