【问题标题】:ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment in Angular 13ERROR 错误:未捕获(在承诺中):错误:无法匹配任何路由。 Angular 13 中的 URL 段
【发布时间】:2022-06-14 00:08:27
【问题描述】:

我正在使用 Angular 和 spring boot 开发一个完整的堆栈项目,如果我试图通过 id 进行更新或显示干预的详细信息,它不起作用并且它向我显示此错误:

ERROR 错误:未捕获(在承诺中):错误:无法匹配任何路由。 URL 段:'intervention-details/2' 错误:无法匹配任何路由。 URL 段:'intervention-details/2' 在 ApplyRedirects.noMatchError (router.mjs:2936:16)

【问题讨论】:

  • 'intervention-details/{id}' 在您的路由模块中丢失。
  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: angular


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    我认为您必须像这样在 app-routing.module 中定义路径: -“更新课程/:id”

    const routes:Routes=[
      
      {path:"update-cours/:id",component:UpdateCoursComponent}
      
    ];

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-14
      • 2018-08-22
      • 2022-11-10
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-21
      相关资源
      最近更新 更多