Why does this subroute not work? I checked this SO question A similar issue. I implemented the solution given, by moving the more specific route to be first, but this did not solve the problem.
App.component.ts
import {Whatsup} from "./whatsup.component";
...
template:`
<li id="whatsup" (click)="loadField('whatsup')" ><a [routerLink]="['/whatsup/...']"> Whatsup?</a></li>
<router-outlet></router-outlet>
`
...
@Routes([
{path: '/whatsup/...', component: Whatsup}
])
Whatsup.component.ts
import {Calendar} from "./Calendar.component";
...
template:`
<li class="list-group-item"><a [routerLink]="['/today']">{{today | date:'EEEEE'}}</a></li>
<router-outlet></router-outlet>
`
...
@Routes([
{path:"/today", component: Calendar}
])
Whatsup loads successfully, but when I click on the link in Whatsup I get this error:
Unhandled Promise rejection: Cannot match any routes. Current segment: 'today'. Available routes: ['/whatsup/...', '/our-recommendations', '/leave-review', '/deals-in-town']. ; Zone: angular ; Task: Promise.then ; Value: Object { message: "Cannot match any routes. Current se…", stack: "BaseException@http://localhost:3000…" }