1

[routerLink]当使用带有或通过using 的锚标记重定向到路由时,它会返回到上一页code

router.navigate(['/path'])

示例:如果我extractedData从结果页面重定向到页面,它只会显示extractedData页面然后立即重定向到结果页面。这是我的路由模块。

export const routes:Routes=[
    { path: '', redirectTo: '/home', pathMatch: 'full' },
    {path:'home', component:HomeComponent, data:{title:'Home'}},
    {path:'list',component:ListComponent, data:{title:'List'}},
    {path:'resultDetails',component:ResultDetailsComponent,data:{title:'Result Details'}},
    {path:'result',component:ResultComponent,data:{title:'Result'}},
    {path:'extractedData',component:ExtractedDataComponent,data:{title:'Extracted Data'}}
]
4

1 回答 1

1

试试下面的代码

router.navigate['/extractedData']
于 2018-06-18T10:11:53.667 回答