I am working on setting up a routing mechanism in my Angular project, but I'm encountering a URL routing error. The application is unable to locate the specified URL.
Below is the routing setup:
navigation.ts
{
id: 'documentation-management',
title: 'Dokümantasyon Yönetimi',
type: 'collapse',
icon: 'feather icon-folder',
children: [
{
id: 'documentation-list',
title: 'Doküman Listesi',
type: 'item',
url: '/tr/documentation-management/documentation/documentation-list'
},
{
id: 'definitions',
title: 'Tanımlar',
type: 'collapse',
children: [
{
id: 'documentation-category',
title: 'Doküman Kategorileri',
type: 'item',
url: '/tr/documentation-management/definitions/documentation-category/documentation-category-list'
}
]
}
]
}
app-routing.module.ts
{
path: ':lang/documentation-management',
loadChildren: './documentation-management/documentation-management.module#DocumentationManagementModule'
}
documentation-management-routing.module.ts
const routes: Routes = [
{
path: '',
children: [
{
path: 'documentation',
loadChildren: './documentation/documentation.module#DocumentationModule'
},
{
path: 'definitions',
loadChildren: './definitions/definitions.module#DefinitionsModule'
}
]
}
];
definitions-routing.module.ts
const routes: Routes = [
{
path: '',
children: [
{
path: 'documentation-category',
loadChildren: './documentation-category/documentation-category.module#DocumentationCategoryModule'
}
]
}
];
documentation-category-routing.module.ts
const routes: Routes = [
{
path: '',
children: [
{
path: 'documentation-category-list',
loadChildren: './documentation-category-list/documentation-category-list.module#DocumentationCategoryListModule'
},
{
path: 'documentation-category-edit',
loadChildren: './documentation-category-edit/documentation-category-edit.module#DocumentationCategoryEditModule'
},
{
path: 'documentation-category-edit/:id',
loadChildren: './documentation-category-edit/documentation-category-edit.module#DocumentationCategoryEditModule'
}
]
}
];
documentation-category-list-routing.module.ts
const routes: Routes = [
{
path: '',
component: DocumentationCategoryListComponent
}
];
I have successfully implemented a similar routing mechanism for a different module, so I'm unsure why this one isn't working as expected.
The goal is to access the specified URLs in the navigation.ts file, but I keep getting the following error:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'tr/documentation-management/definitions/documentation-category/documentation-category-list'
Error: Cannot match any routes. URL Segment: 'tr/documentation-management/definitions/documentation-category/documentation-category-list'
Here is the directory structure of my application:
- app
- documentation-management
- definitions
- documentation-category
- documentation-category-list
- human-resources
- definitions
- education-group
- education-group-list
If you could assist me with this issue, I would greatly appreciate it!