1

It returns back to the previous page when redirect to a route using an anchor tag with [routerLink] or through the code using :

router.navigate(['/path'])

Example : If I redirect to the extractedData page from result page, it will just show the extractedData page then immediately redirecting to the result page.This is my routing module.

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'}}
]
Libin C Jacob
  • 1,108
  • 12
  • 34
  • your routes file looks fine.. `router.navigate['/path']` is wrong, it should be `router.navigate(['/path'])`.. But we can't help much with only the code you are showing. – callback Jun 14 '18 at 08:26
  • @callback Thanks bro.. I've updated the question. Still I am getting the same issue. – Libin C Jacob Jun 14 '18 at 12:39

1 Answers1

1

Try the below code

router.navigate['/extractedData']
vijesh
  • 1,115
  • 1
  • 11
  • 27