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
'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
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>
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>