I am using angular2 cli.
test related to relative problems:
routing configuration:
{
path: '',
component: CheckCompanyComponent,
children:[
{
path:'',
loadChildren: 'app/components/company/check-company-home/check-company-home.module#CheckCompanyHomeModule'
},
{
path:':id',
loadChildren: 'app/components/company/check-company-detail/check-company-detail.module#CheckCompanyDetailModule'
}
]
}
In the component check-company-home
goIdPage(){
this.router.navigate(['22'], { relativeTo: this.route });
}
can move from "/ company" to "/ company / 22"
In the check-company-detail component:
goBack(){
this.router.navigate(['../'], { relativeTo: this.route });
}
But can’t move in the form "/ company / 22" to "/ company",
why?
source
share