update router

This commit is contained in:
Çetin
2021-12-23 17:27:15 +03:00
parent 5ca76d76bc
commit 41a20dee68
3 changed files with 31 additions and 10 deletions

View File

@@ -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 { }

View File

@@ -23,7 +23,8 @@
<div class="col-12 md:col-6">
<div class="card card-w-title">
<h5>Steps</h5>
<p-steps [model]="routeItems" [readonly]="false" (activeIndexChange)="pageIndex = $event" [activeIndex]="pageIndex"></p-steps>
<p>Steps and TabMenu are integrated with the same child routes.</p>
<p-steps [model]="routeItems" [readonly]="false"></p-steps>
<router-outlet></router-outlet>
</div>
</div>
@@ -31,6 +32,7 @@
<div class="col-12 md:col-6">
<div class="card card-w-title">
<h5>TabMenu</h5>
<p>Steps and TabMenu are integrated with the same child routes.</p>
<p-tabMenu [model]="routeItems"></p-tabMenu>
<router-outlet></router-outlet>
</div>