我正在开展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" }];
任何帮助都将不胜感激。