I am working on a shopping web application project using angular 8.
There is a shop url and cms(Content Management system) for the admin.
I want CMS module to be loaded when I navigate to 'localhost:4200/cms'.
Can this be implemented? Following is my code.
//******* app.component.html *********/
<app-header></app-header>
<main role="main">
<router-outlet (message)="handleMessage($event)"></router-outlet>
</main>
<footer class="text-muted">
<app-footer></app-footer>
</footer>
//******* app-routing.module.ts *********/
const routes: Routes = [
{path: '', component:MainComponent, pathMatch:'full'},
{path: 'cart', component: CartComponent},
{path: 'shop/:product_category', component:ProductCategoryComponent},
{path: 'cms', loadChildren: ()=> import ('./cms/cms.module').then(mod=>mod.CmsModule)},
{path: '**', component:NotFoundComponent}
];
//******* cms-routing.module.ts *********/
const routes: Routes = [
{path: '', component:CmsComponent, children:[
{path: '', redirectTo: 'cms'},
{path: 'product-categories', component:ProductCategoriesComponent},
{path: 'product-categories/create', component: CreateProductCategoryComponent},
{path: 'product-categories/edit/:id', component: EditProductCateogryComponent},
{path: 'products', component: ProductsComponent},
{path: 'products/create', component: CreateProductComponent},
{path: 'orders', component: OrdersComponent},
]},
];