When I route to localhost:4200 I expect my route to redirect to localhost:4200/tabs/search as that is my starting route but somehow it stays at the route localhost:4200 and loads MyEventsComponent.
Here is my routes:
App.routes.ts
export const routes: Routes = [
{
path: '',
redirectTo: '/tabs/search',
pathMatch: 'full',
},
{
path: 'tabs',
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsModule)
},
];
tabs.routes.ts
export const tabsRoutes: Routes = [
{
path: '',
component: TabsPage,
children: [
{
path: 'search',
loadChildren: () => import('../search/search.module').then(m => m.SearchModule),
},
{
path: 'myevents',
loadChildren: () => import('../myevents/my-events.module').then(m => m.MyEventsModule),
},
{
path: 'settings',
loadChildren: () => import('../settings/settings.module').then(m => m.SettingsModule),
},
{
path: 'friends',
loadChildren: () => import('../friends/friends.module').then(m => m.FriendsModule),
},
{
path: 'shared',
loadChildren: () => import('../shared/shared.module').then(m => m.SharedModule),
},
{
path: '',
redirectTo: '/tabs/search',
pathMatch: 'full',
},
],
},
{
path: '',
redirectTo: '/tabs/search',
pathMatch: 'full',
},
];
And here is my search.routes.ts
export const searchRoutes: Routes = [
{
path: '',
component: SearchComponent,
},
];
and the last one myevents.routes.ts:
export const myEventRoutes: Routes = [
{
path: '',
component: MyEventsComponent,
},
];
Since my first route in app.routes.ts has a redirect to /tabs/search i expect it to enter my search.routes.ts and match with the default route there and render SearchComponent.ts but it doesn’t. It stays as localhost:4200 and renders MyEventsComponent.
Thanks in advance!
I have tried different setups with my routes but I still get the error