这是我的app-routing.module.ts文件,在编译时出现错误。请提出解决方法。没有“,”在任何地方都消失了。
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { PostListComponent } from './posts/post-list/post-list.component';
import { PostCreateComponent } from './posts/post-create/post-create.component';
const routes: Routes = [
{ path: '', component: PostListComponent},
{ path: 'create', component: PostCreateComponent},
{ path: 'edit/:postId', component: PostCreateComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
}
export class AppRoutingModule {}
答案 0 :(得分:0)
您缺少@NgModule的右括号
react-scripts