angular-component / router

Angular Component Router - A declarative router for Angular applications
MIT License
253 stars 16 forks source link

[Bug] Nested routes do not abide 404 #18

Closed meeroslav closed 4 years ago

meeroslav commented 4 years ago

With parent router set as

 <router>
    <route path="/home">
      <app-home *routeComponent></app-home>
    </route>
    <route path="/user/**">
      <app-user *routeComponent></app-user>
    </route>
    <route path="/" redirectTo="/home"></route>
    <route path="**">
      <app-not-found *routeComponent></app-not-found>
    </route>
  </router>

And user router set as:

<router>
    <route path="/:id">
      <app-user-profile *routeComponent></app-user-profile>
    </route>
    <route path="/">
      <app-user-list *routeComponent></app-user-list>
    </route>
  </router>

Actual: The following route is handled as correct: '/user/first/second/third' and the UserProfile component would extract id param as third.

Expected: The router responds with 404 and renders the NotFound component.