简体   繁体   English

ERROR 错误:未捕获(在承诺中):错误:无法匹配任何路由。 Angular 中的 URL 段 13

[英]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.

相关问题 角单元测试:未捕获错误:未捕获(承诺中):错误:无法匹配任何路线。 网址段:“注销” - Angular Unit Test: Uncaught Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'logout' Angular 测试:未捕获错误:未捕获(承诺中):错误:无法匹配任何路由。 URL 段:“家” - Angular Testing: Uncaught Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'home' 错误:无法匹配任何路由。 URL 段:在 Angular 13 - Error: Cannot match any routes. URL Segment: in Angular 13 NativeScript Angular:错误错误:未捕获(承诺):错误:无法匹配任何路由。 网址段:“ add Patient” - NativeScript Angular: ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'addpatient' Electron + Angular 应用程序 + 错误:未捕获(承诺):错误:无法匹配任何路由。 URL 段: - Electron + Angular Application + Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 角路由错误:未捕获(承诺):错误:无法匹配任何路由。 网址段:“仪表板/配置文件” - Angular Routing Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'dashboard/profile' Ionic 5(Angular9)-错误:未捕获(承诺):错误:无法匹配任何路由。 URL 段:'profile' - Ionic 5(Angular9)-Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'profile' 失败:未捕获(承诺):错误:无法匹配任何路由。 URL段:“登录”。 茉莉花&角6 - Failed: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'login'. Jasmine & Angular 6 角度2命名的出口:未捕获(承诺):错误:无法匹配任何路线。 网址段: - Angular 2 Named Outlet: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 未捕获(承诺):错误:无法匹配任何路线。 URL 段:角度 - Uncaught (in promise): Error: Cannot match any routes. URL Segment: Angular
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM