2017-03-05 83 views
0

我安装的WebPack,一切都很好,但路由不工作了,角2的WebPack-dev的服务器,路由不工作

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路由工作正常之前

+0

你得到的错误是什么? – Aravind

+0

已经找到解决方案我发布它作为答案 –

回答

0

我发现我的错误,而不是“开始”:“webpack-dev-server”,在我使用的package.json中,“start”:“concurrently”npm run build:watch \“\”npm run serve \ “”,