From 41a20dee6818d8fa2b2b302843b3d8b5fa2251ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 23 Dec 2021 17:27:15 +0300 Subject: [PATCH] update router --- src/app/app-routing.module.ts | 10 +------- src/app/demo/view/menu/menudemo.module.ts | 27 ++++++++++++++++++++++ src/app/demo/view/menusdemo.component.html | 4 +++- 3 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 src/app/demo/view/menu/menudemo.module.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 11ee677..c377566 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -46,15 +46,7 @@ import {PaymentDemoComponent} from './demo/view/menu/paymentdemo.component'; {path: 'uikit/panel', component: PanelsDemoComponent}, {path: 'uikit/overlay', component: OverlaysDemoComponent}, {path: 'uikit/media', component: MediaDemoComponent}, - {path: 'uikit/menu', component: MenusDemoComponent, - children: [ - {path:'', redirectTo: 'personal', pathMatch: 'full'}, - {path: 'personal', component: PersonalDemoComponent}, - {path:'seat', component: SeatDemoComponent}, - {path:'payment', component: PaymentDemoComponent}, - {path:'confirmation', component: ConfirmationDemoComponent}, - ] - }, + {path: 'uikit/menu', loadChildren: () => import('./demo/view/menu/menudemo.module').then(m => m.MenudemoModule)}, {path: 'uikit/message', component: MessagesDemoComponent}, {path: 'uikit/misc', component: MiscDemoComponent}, {path: 'uikit/charts', component: ChartsDemoComponent}, diff --git a/src/app/demo/view/menu/menudemo.module.ts b/src/app/demo/view/menu/menudemo.module.ts new file mode 100644 index 0000000..9c87cd1 --- /dev/null +++ b/src/app/demo/view/menu/menudemo.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule, Routes } from '@angular/router'; + +import { PaymentDemoComponent } from './paymentdemo.component'; +import {SeatDemoComponent} from './seatdemo.component'; +import {PersonalDemoComponent} from './personaldemo.component'; +import {ConfirmationDemoComponent} from './confirmationdemo.component'; +import { MenusDemoComponent } from '../menusdemo.component'; + +@NgModule({ + declarations: [], + imports: [ + CommonModule, + RouterModule.forChild([ + {path:'',component: MenusDemoComponent, children:[ + {path:'', redirectTo: 'personal', pathMatch: 'full'}, + {path: 'personal', component: PersonalDemoComponent}, + {path: 'confirmation', component: ConfirmationDemoComponent}, + {path: 'seat', component: SeatDemoComponent}, + {path: 'payment', component: PaymentDemoComponent} + ]} + ]) + ], + exports: [RouterModule] +}) +export class MenudemoModule { } diff --git a/src/app/demo/view/menusdemo.component.html b/src/app/demo/view/menusdemo.component.html index 1f646c4..518ecb6 100755 --- a/src/app/demo/view/menusdemo.component.html +++ b/src/app/demo/view/menusdemo.component.html @@ -23,7 +23,8 @@
Steps
- +

Steps and TabMenu are integrated with the same child routes.

+
@@ -31,6 +32,7 @@
TabMenu
+

Steps and TabMenu are integrated with the same child routes.