Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
Angular child routes getting encoded

Cannot find an applicable example that works anywhere of child component routing used AFTER a parameter:

Right now profile/userName works but the children don't

{ path: 'profile/:userName', component: ProfileComponent, 
    children: [
        { path: 'deets', component: DeetsComponent }
    ]
},    

I get Error: Cannot match any routes. URL Segment: 'profile/admin%40admin.com/%5B'deets'%5D'

Not sure if it's the encoding in the URL or something I'm doing wrong with my routing that's causing the error?

Using Angular 4.1

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

'profile/admin%40admin.com/%5B'reviews'%5D' url contains special characters that got encoded that they do nit match the route's path defined.

See w3schools: https://www.w3schools.com/tags/ref_urlencode.asp

over 4 years ago · Santiago Trujillo Report

0

i simply used this to get things working on angular 4.4; @angular/cli 1.4.5; node 6.11.3;

<a routerLink="/detail/{{item.id}}" routerLinkActive="active"> DETAIL </a>
over 4 years ago · Santiago Trujillo Report

0

This looks like you are probably passing an input to a routerLink property but you aren't wrapping the input property in square brackets.

So routerLink= vs [routerLink]=. If you don't include the square brackets then the link will be treated as a string and you will see those encoding errors when you attempt to navigate to the route.

 <a [routerLink]="['detail', item.id, 'deets']">DETAIL</a>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!