Angular2中的页面刷新导航到主页

时间:2017-10-06 12:00:22

标签: angular angular2-routing

我正在开展Angular 2项目并面临路由问题。假设我现在处于URL http://localhost:58736/#/page1,当我按F5刷新页面时,它会将我重定向到主页。 以下是我的路线配置文件 -

export const appRoutes: Routes = [
{ path: "dashboard", component: DashboardComponent },
{ path: "home", component: HomePageComponent, pathMatch: "full" },
{ path: "page1", component: Page1Component },
{ path: "page2", component: Page2Component },
{ path: "404", component: Error404Component },
{ path: "", redirectTo: "/home", pathMatch: "full" }];

任何帮助都将不胜感激。

0 个答案:

没有答案