I have an app with the next routing structure:
{
path: "home",
component: HomeComponent,
children: [
{
path: "list",
component: ListViewComponent
},
{
path: "dashboard",
component: DashboardComponent
},
{
path: '',
pathMatch: 'full',
redirectTo: 'dashboard'
},
{
path: "**",
redirectTo: 'dashboard'
}
]
}
how I can check if the user navigates into the page by full path eg home/list
or by redirectTo
?
You can check the url by adding:
path: 'team/:id',
component: TeamComponent,
canActivate: ['canActivateTeam']
Here ['canActivateTeam'] can be a function in a service.