Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
Angular child tab outlet routing, redirect does not work

This is an example of my routes, this way it works when I navigate between 'org-entities' and 'org-entities/:id' but this way I have a bug that causes the OrgEntitiesPageComponent to rerender on each navigation even though its the 'same' page.

I'm trying to redirect the route '/asset-management/(tab:org-entities)' to '/asset-management/(tab:org-entities/)' which will solve all my problems but I can't managed to get the redirect to work.

EXAMPLE OF ROUTES

const routes: Routes = [
  {
    path: 'asset-management',
    redirectTo: '/asset-management/(tab:org-entities/)',
    pathMatch: 'full',
  },
  {
    path: 'asset-management',
    data: { breadcrumb: 'Asset Management' },
    component: AssetManagementPageComponent,
    canActivate: [AuthGuard],
    children: [
      {
        path: 'org-entities/:id',
        component: OrgEntitiesPageComponent,
        outlet: 'tab',
        canActivate: [AuthGuard],
      },
      {
        path: 'org-entities',
        component: OrgEntitiesPageComponent,
        outlet: 'tab',
        canActivate: [AuthGuard],
      },
    ],
  },
];

EXAMPLE OF HOW I TRIED TO REDIRECT

const routes: Routes = [
  // solution 1
  {
    path: '/asset-management/(tab:org-entities)',
    redirectTo: '/asset-management/(tab:org-entities/)',
    pathMatch: 'full',
  },
  {
    path: 'asset-management',
    redirectTo: '/asset-management/(tab:org-entities/)',
    pathMatch: 'full',
  },
  {
    path: 'asset-management',
    data: { breadcrumb: 'Asset Management' },
    component: AssetManagementPageComponent,
    canActivate: [AuthGuard],
    children: [
      {
        path: 'org-entities/:id',
        component: OrgEntitiesPageComponent,
        outlet: 'tab',
        canActivate: [AuthGuard],
      },
      // solution 2 - not working
      {
        path: 'org-entities',
        redirectTo: 'org-entities/'
      },
    ],
  },
];
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!