[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'}}
]