routerLink with queryParams doesn't work when opening in a new tab

Discussão em 'Angular' iniciado por kevin, Março 20, 2025.

  1. kevin

    kevin Guest

    In Angular 18, if I have a link defined like this

    <a routerLink="/url" [queryParams]="{ q: 123 }">Link</a>


    Then left-clicking on the link navigates to /url?q=123 as expected. However if I right-click the link and open in a new tab it will navigate to just /url.

    How can I make sure the queryParams are retained when manually opening the link in a new tab?

    Continue reading...

Compartilhe esta Página