這AdminRouting如何在使用多個孩子時使用routerLink?
path: 'adminHome',
component: adminHomeComponent,
children: [
{
path: '',
component: HomeComponent,
},
{
path: 'home',
component: HomeComponent,
},
{
path: 'users',
component: UserListComponent,
children: [
{
path: '',
component: HUComponent
},
{
path: ':id',
component: EntrepriseListComponent,
children: [
{
path: '',
component: HyComponent
},
{
path: ':id',
component: ListLaucauxComponent
},
]
}
]
},
]
},
我想名單LocauxComponent通過點擊企業的ID,以獲取此URL本地主機:3000/adminHome /用戶/ {{id_user}}/{{id_entreprise}} 我嘗試用
[routerLink]="['/adminHome/users/:id',x.id]"
,但我得到的另一個URL類似 http://localhost:3000/adminHome/users/%3Aid/58e35bdeaf314301ec86c249
這個URL有什麼問題? –
我在後端服務器上得到一個nullPointerException異常 –
您可以通過在瀏覽器上手動輸入來檢查您是否通過正確的URL獲取數據嗎? –