简体   繁体   中英

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:

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'intervention-details/2' Error: Cannot match any routes. URL Segment: 'intervention-details/2' at ApplyRedirects.noMatchError (router.mjs:2936:16)

它告诉您您没有与路由器匹配的路由,请检查路由器模块或将您的完整路由发送给我。

i think you must define the path in app-routing.module like that: -"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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM