Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda