错误:无法匹配任何路由。 URL 段:'edit/604c39ab5d06fb205c654043

时间:2021-03-13 11:25:03

标签: javascript angular typescript

它的作用是附加edit/postid 我想在没有 /

的情况下附加 edit:postid
[routerLink]="['edit',post.id]
{ path: "edit:postId", component: PostCreateComponent }

1 个答案:

答案 0 :(得分:1)

你需要像这样改变路线。 { path: "edit/:postId", component: PostCreateComponent } 如果路由中没有 / 内容,您将无法追加。