我很难理解角度路由器的行为。目前,路由模块如下所示:
const routes: Routes = [
{
path: '',
component: ManageCompetitionComponent,
children: [
{
path: ':eventID',
component: EventProfileComponent,
},
],
}];当我打开http://localhost:4200/admin/competition并单击导航到http://localhost:4200/admin/competition/1234的链接时,它工作正常,EventProfileComponent显示为ManageCompetitionComponent的一部分(包含一个路由器出口)。
但是,当我现在从浏览器(例如refresh/F5)调用时:
http://localhost:4200/admin/competition -> works fine
http://localhost:4200/admin/competition/1234 -> redirects to /admin/competition那我怎么才能阻止重定向呢?
发布于 2020-09-15 11:03:00
尝尝这个,
const routes: Routes = [
{
path: '',
component: ManageCompetitionComponent,
},
{
path: ':eventID',
component: EventProfileComponent,
}];https://stackoverflow.com/questions/63900211
复制相似问题