1

I have this routing file:

{
    path: '',pathMatch:'full', loadChildren: () => import('./component/login/login.module').then(m =>
      m.LoginModule)
  },
  {
    path: 'section2', loadChildren: () => import('./componenti/section2/section2.module').then(m =>
      m.Section2)
  },

When I go on http://localhost:4200/

I see the login component and it works fine, but when I put the correct parameters I do:

this.router.navigate(['/section2']);

But when I do on /section do it shows me the login component Anyone can help me?

2
  • Can you show the routing you have declared in the section2 module - that's what's going to determine how your route is matched. Commented Apr 7, 2020 at 10:38
  • u have syntax error componenti Commented Apr 16, 2020 at 9:52

1 Answer 1

2

We can debug it better if you can provide a stackblitz

Looking at above code i can see there is a spelling mistake

./componenti

instead of

/component for section2

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.