Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty path with children not working #159

Open
vatsake opened this issue Jan 5, 2024 · 0 comments
Open

Empty path with children not working #159

vatsake opened this issue Jan 5, 2024 · 0 comments

Comments

@vatsake
Copy link

vatsake commented Jan 5, 2024

This works:

const routes: Routes = [
      {
        path: 'forms',
        loadChildren: () => import('./forms/forms.module').then((m) => m.FormsModule),
      },
      {
        path: 'tempix',
        loadChildren: () => import('./tempix/tempix.module').then((m) => m.TempixModule),
      },
      {
        path: 'switch',
        loadChildren: () => import('./switch/switch.module').then((m) => m.SwitchModule),
      },
      { path: '', pathMatch: 'full', redirectTo: 'forms' },
]

This does not.

const routes: Routes = [
  {
    path: '',
    canActivate: [AuthGuard],
    children: [
      {
        path: 'forms',
        loadChildren: () => import('./forms/forms.module').then((m) => m.FormsModule),
      },
      {
        path: 'tempix',
        loadChildren: () => import('./tempix/tempix.module').then((m) => m.TempixModule),
      },
      {
        path: 'switch',
        loadChildren: () => import('./switch/switch.module').then((m) => m.SwitchModule),
      },
      { path: '', pathMatch: 'full', redirectTo: 'forms' },
    ],
  },
]

BTW even without the guard, it still doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant