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

131
Views
Ruta angular, comportamiento diferente según el estado de inicio de sesión

Tal vez no sea el mejor enfoque, pero quiero usar la misma ruta angular para que los usuarios registrados y no autenticados muestren un componente. Tengo un componente de esqueleto que contiene los componentes después de que el usuario haya iniciado sesión. Si el usuario no ha iniciado sesión, no quiero mostrar el componente de esqueleto, solo el componente en sí.

enrutamiento:

 { path: '', component: SkeletonComponent, canActivate: [AuthGuardService], children: [ { path: 'dashboard', loadChildren: () => import('./dashboard/dashboard.module').then((m) => m.DashboardModule), }, { path: 'opti-inspector', loadChildren: () => import('./opti-inspector/opti-inspector.module').then( (m) => m.OptiInspectorModule ), }, { path: '**', component: PageNotFoundComponent, }, ], },

Quiero presentar un componente de protocolo, que está disponible como elemento secundario de SkeletonComponent si el usuario ha iniciado sesión, o como una ruta separada si el usuario no ha iniciado sesión. ¿Cómo podría lograr esto?

Prueba fallida:

 { path: '', component: SkeletonComponent, canActivate: [AuthGuardService], children: [ { path: 'dashboard', loadChildren: () => import('./dashboard/dashboard.module').then((m) => m.DashboardModule), }, { path: 'opti-inspector', loadChildren: () => import('./opti-inspector/opti-inspector.module').then( (m) => m.OptiInspectorModule ), }, { path: 'protocol', loadChildren: () => import('./protocoll/protocoll.module').then((m) => m.ProtocollModule), }, { path: '**', component: PageNotFoundComponent, }, ], }, { path: 'protocol', loadChildren: () => import('./protocoll/protocoll.module').then((m) => m.ProtocollModule), },
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!