Error Routing

Hello guys, i still get this error when trying to route from one page to another.

Error: Cannot match any routes. URL Segment:
tabs/list/profile/DNKagDWuNX8vkXj4pqiB’

How do i solve this please?

1 Like

Please show your routing file code

import { NgModule } from ‘@angular/core’;
import { RouterModule, Routes } from ‘@angular/router’;
import { TabsPage } from ‘./tabs.page’;

const routes: Routes = [
{
path: ‘tabs’,
component: TabsPage,
children: [
{
path: ‘home’,
children: [
{
path: ‘’,
loadChildren: ‘…/tab1/tab1.module#Tab1PageModule’
}
]
},
{
path: ‘list’,
children: [
{
path: ‘’,
loadChildren: ‘…/tab2/tab2.module#Tab2PageModule’,
}
]
},
{
path: ‘profile’,
children: [
{
path: ‘’,
loadChildren: ‘…/tab3/tab3.module#Tab3PageModule’
}
]
},
{
path: ’ profile/:id’,
children: [
{
path:’’,
loadChildren: ‘…/tab3/tab3.module#Tab3PageModule’
}
]
},
{
path: ‘’,
redirectTo: ‘/tabs/home’,
pathMatch: ‘full’
}
]
},
{
path: ‘’,
redirectTo: ‘/tabs/home’,
pathMatch: ‘full’
}
];

@NgModule({
imports: [
RouterModule.forChild(routes)
],
exports: [RouterModule]
})
export class TabsPageRoutingModule {}

From your children structure, profile is not a child of list so change your route to tabs/profile/DNKagDWuNX8vkXj4pqiB’

1 Like

Will try this piece of code

Thank you so much! i’m very grateful. I will try it now