Route interface
This is the documentation for Angular 6.
You can switch to the latest version Angular 10.
You can switch to the latest version Angular 10.
Routes
is an array of route configurations. Pass it to the RouterModule.forRoot
or forChild
method in the module imports to configure the router.
Example
...
RouterModule.forRoot([
{
path: 'team/:id',
component: Team,
children: [{
path: 'user/:name',
component: User,
}],
},
]),
Options
path
#
path?: string
pathMatch
#
pathMatch?: string
matcher
#
matcher?: UrlMatcher
component
#
component?: Type<any>
redirectTo
#
redirectTo?: string
Links & Tutorials
outlet
#
outlet?: string
Links & Tutorials
canActivate
#
canActivate?: any[]
canActivateChild
#
canActivateChild?: any[]
canDeactivate
#
canDeactivate?: any[]
canLoad
#
canLoad?: any[]
data
#
data?: Data
resolve
#
resolve?: ResolveData
Links & Tutorials
children
#
children?: Routes
loadChildren
#
loadChildren?: LoadChildren
Links & Tutorials
runGuardsAndResolvers
#
runGuardsAndResolvers?: RunGuardsAndResolvers