Questions tagged [routerlink]

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

312 questions
2
votes
2 answers

When Id change in *ngFor dynamic Routes not working in Angular 6

`` Link is changing when I click on link But page Content not changed from http://localhost:4200/projects/1…
riya jain
  • 23
  • 7
2
votes
4 answers

How to give dynamics values for [routerLink] which it corresponds to values of an array?

I want to make a dynamic routing into my template. Values of routing come from an array which is iterated with ngFor. Also I want to make some transformations to this values which are of type string. Thanks I tried to put values from an array but…
N.Y
  • 185
  • 1
  • 9
2
votes
1 answer

How to use a variable route with a named router-outlet?

I have a key value pair. The value of the pair is a route. I am using a named router-outlet. I cannot find the correct syntax for this. Any help is appreciated. .ts: public myPair: { [key: string]: string } = { 'Keyvalue':…
Logic01
  • 115
  • 1
  • 7
2
votes
2 answers

Error with VueJs router-link element

Every time I click on one of my vuejs router-link elements in my app.blade.php page navigation bar, I end up getting an error on my console as seen below [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the…
Mamod1
  • 50
  • 1
  • 10
2
votes
2 answers

Observable.combineLatest is not a function

I have a Home page, somewhere in it the user clicks on Contact me to be redirected to the Contact page: home.component.html home.component.ts: import { Component,…
2
votes
1 answer

Angular Child Route not working and redirect me to the same page

I have tried to change my route and so far I didn't find any issues. But if you find any flaws please let me know, also I try to find any type error and double-check my components, so far I didn't find one, but then again let me know. I try to type…
jricc russel
  • 61
  • 3
  • 9
2
votes
1 answer

Customize routerLink in Angular 5

In my application I am using routerLink to create my link as per according to parameter passed in routerLink. Above code generate links with the userId provided, but I want to customize angular…
ankit sharma
  • 449
  • 1
  • 6
  • 17
2
votes
0 answers

RouterLink not working Header MegaMenu

I am currently working in ecommerce website in angular5. I am facing an issue in routerLink navigation. When i use routerLink in netsted ngFor the routerlink triggering at first time only..second clicks not working. But when i am click sublevel menu…
sabari
  • 31
  • 4
2
votes
1 answer

Should I use routerLink only with anchors or is it okay to use it on other HTML elements too?

Let's say that I have a logo on my website, should I link it this way: logo or maybe like this: logo What about headlines?
user3812733
  • 165
  • 1
  • 9
2
votes
0 answers

Angular Material 2 Tab Links unable to set default active tab

After a successful login on the login page, the route changes to the "inbound" view, which has two tabs in the navbar, "inbound" and "outbound". I'd like for the "inbound" navtab to be already selected to reflect the state of the router. However,…
2
votes
0 answers

Angular 2 RouterLinkActive class for child routes

I have a nav component with a sub nav associated to it. The data structure is as follows: { title: 'Layout', routerLink: 'layout', // main nav subNav: // sub nav { title: 'Layout', items: [ { title: 'Layout',…
BradBeighton
  • 83
  • 1
  • 9
2
votes
2 answers

Format routerLink param url

In my angular 2 app I have defined a router link like : example Currently I am getting demo.name as "example.net/demo/A%20%demo%20%test". I want to format this as…
Sumit Chaudhari
  • 210
  • 1
  • 15
1
vote
1 answer

Use either routerLink or href based on value whether it is internal or external

I want in my anchor elements to use either [routerLink] if the provided url is external or [href] whether it's internal url. The problem is i don't know what url it will be, because it comes from backend. I tried to use directive and replace…
Gigaxit
  • 11
  • 4