DEV Community

Andrei Gatej
Andrei Gatej

Posted on

Angular: Why RouterLink adds the input to the end of current URL in bracket

Lets say my url is: http://localhost:4200/user_id/home. Here is my button code:

  <ion-button [routerLink]="['some_user_id', 'payments']" routerLinkActive="selected"&gt
    <ion-label class="label">Payments</ion-label>

Because I was getting Error: Cannot match any routes. I started to investigate the problem and I come to, that routerLink is generating such DOM element:

<a href="user_id/home/(some_user_id/payments)" class="button-native" part="native">

When (in…

Discussion (0)