Routing Configuration
const routes: Routes = [
{ path: '', loadChildren: './home/home.module#HomeModule' },
{ path: 'admin', loadChildren: './admin/admin.module#AdminModule' }
];
Nested Home Routing
const routes: Routes = [
{path: '', component: HomeComponent, children: [
{path: 'inner', loadChildren: './home-inner/home-
inner.module#HomeInnerModule'},
]}
];
Inner Home Routing
const routes: Routes = [
{path: '', component: HomeInnerComponent}
];
Explore the example on GitHub here and test it on StackBlitz here
If you click on inner twice, you may encounter a routing issue. The route will be redirected to inner/(inner). This issue may occur with other routes as well.
Looking for a solution?