我的Angular路由设置中配置了几个路由。但是event /:id会干扰事件/注册。我认为优先事项可以解决这个问题。
@NgModule({
imports: [
RouterModule.forRoot([
{ path: '', component: EventComponent },
{
path: 'event',
component: EventComponent
},
{
path: 'event/register',
component: RegisterEventComponent
// canActivate: [AuthGuard]
},
{
path: 'event/:id',
component: EventComponent
// canActivate: [AuthGuard]
}
])
]
它返回此错误:
GET http://localhost:4200/event/runtime.js net::ERR_ABORTED
我该如何做?