Simple routing problem

Hi, I have three pages: Home, Signup, Signuptwo.
"Home" is the main page which after 4 seconds redirect you to the "home/signup" page and inside it when you press a button it supposed to redirect you to "home/signuptwo" page.

When i'm inside "home/signup" page and i try to press the button it shows me this error:

Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'home/signup/signuptwo' Error: Cannot match any routes. URL Segment: 'home/signup/signuptwo' 

There is a url problem because it's going for home/signup/signuptwo instead of home/signuptwo

This is the structure:
https://i.imgur.com/os9MLPN.png

app-routing:

const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', children: [ { path: '', loadChildren: './home/home.module#HomePageModule' }, { path: 'signup', loadChildren: './home/signup/signup.module#SignupPageModule' }, { path: 'signuptwo', loadChildren: './home/signuptwo/signuptwo.module#SignuptwoPageModule' } ] } ]; 

sign-up module:

const routes: Routes = [ { path: '', component: SignupPage } ]; 

sign-up-two module:

const routes: Routes = [ 

{ path: '', component: SignuptwoPage } ];

Thanks a lot!

submitted by /u/Prince_Willian
[link] [comments]
Source: Reddit

Related Post