Cannot match children routes of blank path

Discussão em 'Angular' iniciado por Michał B, Março 14, 2025.

  1. Michał B

    Michał B Guest

    I have this configuration in my routing in Angular:

    ...
    {
    path: 'account',
    canActivate: [AuthGuardService],
    children: [
    {
    path: '',
    component: AccountPageComponent,
    outlet: 'modal',
    children: [
    {
    path: 'pets',
    component: PetsComponent,
    children: [
    {
    path: ':id',
    component: PetComponent,
    }
    ]
    },
    {
    path: 'user',
    component: UserComponent,
    }
    ]
    }
    ]
    }
    ...


    Account route is working as expected and opening in desired outlet. AccountPageComponent has his own nameless outlet for this route children. But when I'm navigating to any of them I'm receiving following errors:


    NG04002: Cannot match any routes. URL Segment: 'account/user'

    NG04002: Cannot match any routes. URL Segment: 'account/pets'
    ​

    How can I fix this?

    Thanks

    Continue reading...

Compartilhe esta Página