angular 2 webpack-dev-server,路由无法正常工作

时间:2017-03-05 17:48:36

标签: angular webpack webpack-dev-server

我安装webpack,一切都很好,但路由不再工作了,

export const appRoutes: Routes = [
  { path: '', pathMatch: 'full', redirectTo: 'main' },
  { path: 'login', component: LoginComponent },
  { path: 'main', component: mainPage },
  { path: 'verification', component: Verification },
  { path: 'profile', component: Profile },
  { path: 'search', component: Search },
  { path: 'userProfile', component: UserProfile },
];

在我安装webpack路由之前工作正常

1 个答案:

答案 0 :(得分:0)

我发现了我的错误,而是"开始":" webpack-dev-server",在我使用的package.json中,"开始":&#34 ;同时运行构建:观察\" \" npm run serve \"",