Cod*_*ein 5 angular-routing angular angular-router-guards angular-router
如果我的 Angular 应用程序,如果我导航(通过明确输入 URL 或单击指向它的页面链接)到http://localhost:4200/#/sign-in页面加载正常并显示我的登录表单。如果我然后Refresh在浏览器中单击,我将被带回根页面http://localhost:4200/#/。
我的路由器很简单:
export const routes: Route[] = [
{ path: 'sign-up', component: SignUpComponent},
{ path: 'sign-in', component: SignInComponent},
{ path: 'admin', loadChildren: 'app/admin/admin.module#AdminModule'},
{ path: 'dashboard', loadChildren: 'app/user/user.module#UserModule', canActivate: [ UserLoggedInGuard ]},
{ path: '', pathMatch: 'full', component: HomeComponent},
{ path: '**', pathMatch: 'full', component: PageNotFoundComponent},
]
Run Code Online (Sandbox Code Playgroud)
我在用
@angular/core": "^4.2.4@angular/router": "^4.2.4任何想法为什么会发生这种情况?
| 归档时间: |
|
| 查看次数: |
1456 次 |
| 最近记录: |