我正在研究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" }];

任何帮助,将不胜感激 .