I have an angular application In that I have some navigation of routerlinks
My requirement is if the user page is already open with some Id ,and if the condition satisfies in then it has to navigate to that particular ID user page from the existing user page with ID.
.component.ts
if(userID == 0){
this.router.navigate(['./user/' + userID]);
}
else{
this.router.navigate(['./details']);
}
From the above code if I am already in the user page with id then condition satisfies in if condition then we have to navigate to that particular user page with that ID.
Can anyone help me on the same