Reputation: 1138
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'}}
]
Upvotes: 1
Views: 701
Reputation: 1
I encountered the same error but in another context. You can consider trying use event.preventDefault();
Upvotes: 0