Hey guys,
I’m currently struggling with navigation in Ionic 4. I’m using the tabs template. I’m just trying to navigate one route deeper inside a tab. My tabs.routing.module
looks like this:
const routes: Routes = [
{
path: 'tabs',
component: TabsPage,
children: [
{
path: '',
redirectTo: '/tabs/(home:home)',
pathMatch: 'full',
},
{
path: 'home',
outlet: 'home',
component: HomePage
},
{
path: 'info',
outlet: 'info',
component: InfoPage,
children: [
{ path: 'item', outlet: 'info', component: ItemInfoPage}
]
},
{
path: 'about',
outlet: 'about',
component: AboutPage
},
{
path: 'contact',
outlet: 'contact',
component: ContactPage
}
]
},
{
path: '',
redirectTo: '/tabs/(home:home)',
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class TabsPageRoutingModule {}
As you can see I have 4 tabs. Inside the InfoPage (which is a tab) I have a nested Page called item-info
. I thought with setting up a child route for the info tab I could navigate via /tabs/(info:info)/item
to my nested item-info.page
. But that I won’t work. I will just get redirected to /tabs/(info:info)
Also I don’t get why I have to navigate to /tabs/(info:info)
to reach my info
tab. I mean the path I setup was info
. Why can’t I just use /tabs/info
?