const routes: Routes = [
{
path: '',
component: TabsPage,
children: [
//new page add
{
path: 'home',
children: [
{
path: '', loadChildren: () => import('../AllPages/home/home.module').then(m => m.HomePageModule)
},
{
path: 'new-arrival',
children: [
{
path: '',
loadChildren: () => import('../AllPages/new-arrival/new-arrival.module').then(m => m.NewArrivalPageModule)
},
{
path: 'product-item-list',
children: [
{
path: '',
loadChildren: () => import('../Allpages/product-item-list/product-item-list.module').then(m => m.ProductItemListPageModule)
},
{
path: 'product-details',
children: [
{
path: '',
loadChildren: () => import('../Allpages/product-details/product-details.module').then(m => m.ProductDetailsPageModule)
},
]
}
]
}
]
},
Use Ionic NavController instead of Angular Router.
Then, use the navigateRoot
method.
Going root means that all existing pages in the stack will be removed, and the navigated page will become the single page in the stack.
import { NavController } from '@ionic/angular';
...
constructor(private navController: NavController) {}
...
this.navController.navigateRoot('/tabs/home');