Search code examples
javascriptangulartypescriptrouterlink

How to add queryParams without routerLink Click in angular?


I wonder add queryParams to url without router.navigateByUrl or routerLink Click in angular

I did not try anything

add Query params to url


Solution

  • try add [queryParams] directive

    <a routerLink="contact" [queryParams]="{first:fu,last:bar}" >
       Contact
    </a>