Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda