📜  core.js:15724 错误错误:未捕获(承诺):错误:无法匹配任何路由. URL 段:'更新 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:41.248000             🧑  作者: Mango

代码示例1
const routes: Routes = [
  {path:"", redirectTo:"/home", pathMatch:"full"},
  {path:"home", component:HomeComponent},
  {path:"add", component:AddComponent},
  {path:"edit/:id", component:EditComponent},
  {path:"show/:id", component:ShowComponent}
];
@NgModule({
  imports: [

    CommonModule,
    RouterModule.forRoot(routes)
  ],
  exports: [RouterModule],
  declarations: []
})
export class AppRoutingModule { }