I want to use the same path ticket
because I want to redirect when save something (Use same component to Update Ticket ).
But there is a problem with canActivate
. What is the best way to fix it?
const router: Routes = [
{
path: '',
component: HomeLayoutComponent,
canActivate: [AuthGuard],
children: [
{
path: '',
component: HomeComponent
},
{
path: 'ticket',
canActivate: [SupportGuard],
component: TicketComponent
},
{
path: 'ticket',
canActivate: [CustomerGuard],
component: SiteTicketComponent
},
....
]
},
{
path: '',
component: LoginLayoutComponent,
children: [
{
path: 'login',
component: LoginComponent
},
{
path: 'signup',
component: SignupComponent
},
]
},
{
path: '**',
component: Error404Component
}
]
Thanks in advance.