0

I work on Angular project and for now I have only one lazy loaded module. When I try to reach localhost:4200/budget I want it to redirect to localhost:4200/budget/expenses. Budget is lazy loaded component. But when I try:

path: '',
component: BudgetComponentComponent,
redirectTo: 'expenses',
children: [
  {
    path: 'expenses',
    pathMatch: 'full',
    component: ExpensesComponent,
  },
  {
    path: 'income',
    pathMatch: 'full',
    component: IncomeComponent
  }
  // { path: '**', component:  Page404Component}
]

it gives me this: enter image description here

my main routing file: enter image description here

1 Answer 1

1
path: '',
component: BudgetComponentComponent,
children: [
  {
    path: '',
    pathMatch: 'full',
    redirectTo: 'expenses',
  {
    path: 'expenses',
    component: ExpensesComponent,
  },
  {
    path: 'income',
    pathMatch: 'full',
    component: IncomeComponent
  }
  // { path: '**', component:  Page404Component}
]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.