When using angular < 16, I used to have this routes configuration:
{
path: Section.Security,
canActivate: [AuthGuard, AccessGuard, AdminGuard],
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'administrators'
},
{
path: '',
outlet: 'left-menu',
canActivate: [AuthGuard],
loadComponent: () => import('@app/components/left-menu/left-menu.component').then(m => m.SecurityLeftMenuComponent)
},
{
path: 'administrators',
canActivate: [AuthGuard],
loadComponent: () => import('@app/pages/security/security.page').then(m => m.SecurityHomePage)
},
{
path: 'contributors',
canActivate: [AuthGuard],
loadComponent: () => import('@app/pages/security/security.page').then(m => m.SecurityHomePage)
},
{
path: 'readers',
canActivate: [AuthGuard],
loadComponent: () => import('@app/pages/security/security.page').then(m => m.SecurityHomePage)
}
]
}
And, in the SecurityLeftMenuComponent
, I had simple links to sub routes like:
<a class="item"
routerLinkActive="active"
routerLink="administrators">
<rn-key name="security::administrators" />
</a>
It was working very well but since I updated to angular 16, the links generated by routerLink now have a different format: "/security/(readers//left-menu:administrators)"
I could fix this by using:
<a class="item"
routerLinkActive="active"
routerLink="/security/administrators">
<rn-key name="security::administrators" />
</a>
But the goal is to have relative links. I tried using "./" but I still have the same issue.
What would be the best way to keep the same behavior as before?
Edit:
As I'm in the process of migrating several applications, I noticed that the issue really occurs when using relative routes. I didn't encounter any issue in the absolute route of the other applications