src / app / app-routing.module.ts(17,1)中的错误:错误TS1005:“,”应为

时间:2019-01-29 17:35:25

标签: angular6

这是我的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 {}

1 个答案:

答案 0 :(得分:0)

您缺少@NgModule的右括号

react-scripts