I have a main module and some submodules. And I want to specify some not trivial routing between them.
I\'d prefer defining the routes of a submodule within the sub
in your appRoutes add child route like
const appRoutes = [
{ path: '', component: HomeComponent },
{
path: 'settings',
component: CountryComponent,
canActivate: [AuthGuard],
children: COUNTRY_ROUTES
},
];
Create a separate routes file
export const COUNTRY_ROUTES:Routes = [
{ path: 'country', redirectTo: 'country/list' },
{ path: 'country/list', component: CountryListComponent },
{ path: 'country/create', component: CountryCreateComponent },
];
In CountryComponent.html