[英]route changes address but doesn't do anything
Here are my routes.这是我的路线。
export const routes: Routes = [
{ path: 'signin-callback', component: SigninCallbackComponent },
{
path: '',
component: DatasetListComponent,
children: [
{
path: 'login',
component: LoginComponent
},
{
path: 'datasets',
component: DatasetListComponent
},
{
path: 'dataset/:datasetId',
component: DatasetComponent
}
]
},
];
At /datasets
the page loads and loads the list of datasets as expected.在
/datasets
页面加载并按预期加载数据集列表。
A link一条链接
<a class="btn btn-primary" [routerLink]="['dataset', d.DatasetId]">
Updated the browser address -- complete with the id
, but nothing happens.更新了浏览器地址——用
id
完成,但没有任何反应。
What's going on?这是怎么回事?
The problem is children
.问题是
children
。 Moving the route objects to be siblings of the parent level makes it work.将路由对象移动到父级别的兄弟使其工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.