I have an Angular app where the root directory is a variable route parameter:
/:demo_profile/(etc).
I cannot use relative path because my routerLink is available from different components/routes.
How can I set a routerLink
target that is relative to the root of my site, followed by this param? i.e.
/SomeRoute/home
My routes:
const routes: Routes = [
{
path: ':demo_profile',
children: [
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: 'home',
component: HomeComponent,
},
{
path: 'cards',
component: CardsComponent,
},
{
path: 'card/:id',
component: CardComponent,
},
{
path: 'help',
component: HelpComponent,
},
{
path: '**',
redirectTo: ':demo_profile',
}
]
},
{
path: '\**',
redirectTo: '/DGInsureCo/home',
}
];