如何获取您所在的当前路线及其数据、子项和父项?
如果这是路由结构:
const routes: Routes = [
{path: 'home', component: HomeComponent, data: {title: 'Home'}},
{
path: 'about',
component: AboutComponent,
data: {title: 'About'},
children: [
{
path: 'company',
component: 'CompanyComponent',
data: {title: 'Company'}
},
{
path: 'mission',
component: 'MissionComponent',
data: {title: 'Mission'}
},
...
]
},
...
]
如果我目前在 CompanyComponent 中,我如何获得我当前的路线 w/c is Company,获取其父 w/c is about、其数据及其兄弟姐妹(例如任务等)?