[英]ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment in Angular 13
I am working on a full stack project with Angular and spring boot, if I am trying to do update or show details of intervention by id, it's not working and it shows me this error:我正在使用 Angular 和 spring 启动一个完整的堆栈项目,如果我试图通过 id 进行更新或显示干预的详细信息,它不起作用,它向我显示此错误:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. ERROR 错误:未捕获(在承诺中):错误:无法匹配任何路由。 URL Segment: 'intervention-details/2' Error: Cannot match any routes.
URL 段:“intervention-details/2”错误:无法匹配任何路由。 URL Segment: 'intervention-details/2' at ApplyRedirects.noMatchError (router.mjs:2936:16)
URL 段:ApplyRedirects.noMatchError (router.mjs:2936:16) 处的“intervention-details/2”
它告诉您您没有与路由器匹配的路由,请检查路由器模块或将您的完整路由发送给我。
i think you must define the path in app-routing.module like that: -"update-cours/:id"我认为您必须像这样在 app-routing.module 中定义路径:-“update-cours/:id”
const routes:Routes=[ {path:"update-cours/:id",component:UpdateCoursComponent} ];
If you are in same module, you can just call directly from your app-routing module otherwise you can define it like this如果您在同一个模块中,您可以直接从您的应用程序路由模块调用,否则您可以像这样定义它
const routes: Routes = [
{
path: 'auth',
component: AuthComponent,
children: [
{ path: 'login', component: LoginComponent },
{ path: 'register', component: RegisterComponent },
],
},
];
here auth is my different module这里 auth 是我的不同模块
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.