Sam*_*ara 5 office-js angular2-routing angular
注意使用相关代码段进行编辑
我遇到了一个奇怪的问题,在发出router.navigate时进入了无限重定向循环。
设定
LoginViewComponent具有两个行为:
重定向仅通过以下逻辑位发出:
this.router.navigate(["foo"])
const routes: Routes = [
{
path: "",
redirectTo: "login",
pathMatch: "full"
},
{
path: "login",
component: LoginViewComponent
},
{
path: "foo",
component: FooComponentView
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: true, enableTracing: true})],
exports: [RouterModule]
})
export class AppRoutingModule { }
Run Code Online (Sandbox Code Playgroud)
问题
| 归档时间: |
|
| 查看次数: |
1459 次 |
| 最近记录: |