1

I have a main component with routes:

@Routes([
            {
                path     : "/auth/login",
                component: AuthComponent
            },
            {
                path     : "/",
                component: DefaultComponent
            }
        ])

DefaultComponent routes:

@Routes([
            {
                path     : "/",
                component: LevelListComponent
            },
            {
                path     : "/levels/:id/add",
                component: LevelListComponent
            },
            {
                path     : "/levels/:id/edit",
                component: LevelListComponent
            },
            {
                path     : "/scripts",
                component: ScriptListComponent
            }
        ])

When I try to navigate to /scripts I see an error:

app.js:44947 EXCEPTION: Error: Uncaught (in promise): Cannot match any routes. Current segment: 'undefined'. Available routes: ['/auth/login', '/']

In beta I could do:

{
   path: "/...",
   component: SomeComponent
}

But now it's not working.

And how can I do create a dynamic route in template?

<a [routerLink]="menuItem.url">
Illorian
  • 1,222
  • 2
  • 13
  • 38

1 Answers1

2

Reorder the routes in DefaultComponent so that the more specific ones come first and the less specific ones come last (/ to be the last one). This is a know issue and will probably be fixed with the next release.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567