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
3
votes
3 answers

Angular 8 routerLinks create decoded href with # to %23

I have one problem with generating routerLinks in my application. I retrieve the menu structure from API. Fetch it when app initializes, store it in the Observable and then simply show it. The part of the structure im showing is pretty…
Marcin Wojtach
  • 135
  • 1
  • 8
3
votes
1 answer

ROUTERLINK does not support Focus event

This is a snippet of my code from a Vue.js application
  • CompanyDroneFromSector7G
    • 4,291
    • 13
    • 54
    • 97
  • 3
    votes
    1 answer

    How to disable navigation animation?

    I have a project with a tabs component that is working fine until I want to implement navigation within a tab. For example, my TEAM tab has 2 subtabs/sections/pages TACTICS and INFORMATION, and if I'm on my tactics tab and I click this…
    CejasLocas
    • 33
    • 3
    3
    votes
    2 answers

    Angular - Issue with routerLink and state

    From an html page I want to route to another page using routerLink and state. With tag there's no issues, during ngOnInit in landing page, I can retrieve state as expected. Using tag home page is navigate as well but state results…
    Xilo
    • 77
    • 1
    • 1
    • 8
    3
    votes
    1 answer

    With vue.js, how can I set up a dynamic router-link with embedded children?

    My router.js has some embedded children: routes: [{ path: '/', name: 'login', component: Login, }, { path: '/app', component: Container, children: [{ …
    Shamoon
    • 41,293
    • 91
    • 306
    • 570
    3
    votes
    0 answers

    router click.native passes wrong parameter in Vue

    I am trying to pass an account to a removal method in Vue. I output the account right before the router-link and it shows the correct one, but outputting account in the method shows a different one. HTML // OUTPUTTING {{chosenAccount}} // ROUTER…
    A.J
    • 1,140
    • 5
    • 23
    • 58
    3
    votes
    2 answers

    QueryParams within RouterLink not working

    I am passing dynamically generated URL with queryParams inside [routerLink] and it breaks routes. i.e: this.url = '/question/ask?details=1' {{ data.name }} When we mouseover it looks something like this…
    Kamran Khatti
    • 3,754
    • 1
    • 20
    • 31
    3
    votes
    0 answers

    Angular6 - Where to import RouterModule to prevent "Can't bind to 'routerLink' since it isn't a known property of 'a"

    I'm having difficulty in placing the RouterModule to prevent a router link html error. Category Component Displays a list of categories Displays a list of albums in those categories by adding the albums element to the categories html:…
    user8516249
    3
    votes
    0 answers

    AngularDart [routerLink] does not append parent path

    I have been building some simple child routes in AngularDart 5. The app contains the following components: login_register_component -> localhost:8080/#/portal login_component -> localhost:8080/#/portal/login register_component ->…
    Tobias Marschall
    • 2,355
    • 3
    • 22
    • 40
    3
    votes
    1 answer

    Why is the [routerLink] directive selector defined as :not(a)[routerLink]?

    In the Angular documentation, the routerLink directive selectors is defined as : :not(a)[routerLink] To my knowledge, this means "all non tags that have the attribute routerLink". However, later in the same documentation they show examples of…
    CodyBugstein
    • 21,984
    • 61
    • 207
    • 363
    3
    votes
    1 answer

    Dynamic queryParams with a routerLink link in Angular

    I'm trying to pass a parameter to my routerLink within a loop. Here is what the array of objects looks like: Here is the loop with the routerLink link:
  • example from multiple sources does not…
  • Ben Racicot
    • 5,332
    • 12
    • 66
    • 130
    3
    votes
    1 answer

    Binding URL Params via RouterLink in Angular App

    I am trying to understand what a basic implementation of loading a routerLink while also pulling in saved url params would look like. Normally, the way I handle routing in my app is via a subscribing to an observable, that looks like this: private…
    Muirik
    • 6,049
    • 7
    • 58
    • 116
    3
    votes
    1 answer

    Handling Dynamic URL Params via RouterLink in Angular App

    In my Angular 2 app I have a tab area where users can select from a group of independent, but contextually related components. When they click on one of these links, the relevant component loads according to what's defined in the routerLink, like…
    Muirik
    • 6,049
    • 7
    • 58
    • 116
    3
    votes
    4 answers

    Angular 2 ngOnInit is not called when routerlink changes

    I have a menu bar that contain a list of menus loaded from express API and every menu is referenced to a page that have an alias which will be the URL of that page. I am trying to load the page when I click to menu, it's done but only when I refresh…
    Ilyes Atoui
    • 474
    • 2
    • 9
    • 29
    3
    votes
    2 answers

    Angular 4 router is appending components on routerLink navigation instead of destroying them

    When navigating from within a submodule from a child route to another sibling child route, instead of the router destroying the previous component, it appends the new one on navigation forward and backward. Why is this happening? Starting in…
    TetraDev
    • 16,074
    • 6
    • 60
    • 61