![](/img/trans.png)
[英]Angular Unit Test: Uncaught Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'logout'
[英]ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment in Angular 13
我正在使用 Angular 和 spring 启动一个完整的堆栈项目,如果我试图通过 id 进行更新或显示干预的详细信息,它不起作用,它向我显示此错误:
ERROR 错误:未捕获(在承诺中):错误:无法匹配任何路由。 URL 段:“intervention-details/2”错误:无法匹配任何路由。 URL 段:ApplyRedirects.noMatchError (router.mjs:2936:16) 处的“intervention-details/2”
它告诉您您没有与路由器匹配的路由,请检查路由器模块或将您的完整路由发送给我。
我认为您必须像这样在 app-routing.module 中定义路径:-“update-cours/:id”
const routes:Routes=[ {path:"update-cours/:id",component:UpdateCoursComponent} ];
如果您在同一个模块中,您可以直接从您的应用程序路由模块调用,否则您可以像这样定义它
const routes: Routes = [
{
path: 'auth',
component: AuthComponent,
children: [
{ path: 'login', component: LoginComponent },
{ path: 'register', component: RegisterComponent },
],
},
];
这里 auth 是我的不同模块
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.