Sergey Scream
Sergey Scream

Reputation: 45

Angular replaced "/" to "%2F" in URL

I have a <a> tag

<a [routerLink]='[{ outlets: { userDetail: ["user/" + user.id] } }]'>
     <h4>{{user.name}}</h4>
</a>


<router-outlet name="userDetail"></router-outlet>

but finally this replaced to http://localhost:4200/users/(userDetail:user%2F1).

How I can change "%2F" to "/" ?

Upvotes: 2

Views: 413

Answers (1)

StepUp
StepUp

Reputation: 38094

Try to declare without + and / signs and use ,:

<a [routerLink]='[{ outlets: { userDetail: ['user', user.id] } }]'>
     <h4>{{user.name}}</h4>
</a>

Upvotes: 2

Related Questions