Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
Secondary router-outlook in child component

Am I allowed to put a secondary router-outlet in any other component other than the AppComponent? Because currently when I do this and I try to activate it using a [routlerLink] I get an error in the console complaining that it cannot find an outlet named popup. If I move it back to AppComponent it works!

So here's the structure of my project:

app/
├──auth/
│  └──login/
│     └──login.component.ts/html/scss
├──landing/
│  ├──landing.module.ts
│  ├──landing.routing.ts
│  └──landing.component.ts/html/scss
├──app.module.ts
├──app.routing.ts
└──app.component.ts/html/scss

And here's the relevant code (landing.routing/landing.component.html):

const routes: Routes = [{
  path: '',
  component: LandingComponent,
  children: [{
    path: 'login',
    component: LoginComponent,
    outlet: 'popup'
  }]
}];
<p>
  <a [routerLink]="[{ outlets: { popup: ['login'] } }]">Login</a>
</p>
<router-outlet></router-outlet>
<router-outlet name="popup"></router-outlet>

...and finally the app.routing.ts routes:

const routes: Routes = [
    { path: 'landing', loadChildren: 'app/landing/landing.module#LandingModule' },
    { path: '', component: HomepageComponent, canActivate: [AuthGuard] },
    { path: '**', component: NotFoundComponent }
];

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda