Heyo, got a SPA with 5 pages, each page beside login page got nav, which from there I'm navigating through the app via routerLink.
I'm looking for that with each route the existing URL(without the main segment) will run over the existing segment and route me to the requested URL.
const routes: Routes = [
{path:'', component:LoginComponent},
{path:'main_page', component:MainpageComponent},
{path:'add_computer', component:AddcomputerComponent},
{path:'edit_computer', component:EditcomputerComponent},
{path:'remove_computer', component:RemovecomputerComponent},
];
for example: the user located at = http://localhost:4200/main_page and I want him to redirect to = http://localhost:4200/add_computer.
But what actually happens is that = http://localhost:4200/main_page/add_computer.
I've found a few roundabout solutions, but I've heard there's a proper solution for that.
Example of my navbar:
<a routerLink="main_page">Main Page</a><br><br>
<a routerLink="add_computer">Add Computer</a><br><br>
<a routerLink="edit_computer">Edit Computer</a><br><br>
<a routerLink="remove_computer">Remove Computer</a><br><br>