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

127
Vistas
Multiple layouts for different components in angular 2+

I want to integrate multiple layouts for different components so I created 2 different layouts.
i.e. inside.html, inside.ts and outside.html, outside.ts.
Both components have different selectors so which one should I use in index.html file ? What is the exact way to achieve this ?

<div *ngIf="true">
<div id="wrapper">
  <navbar></navbar>
  <div class="gray-bg">
    <router-outlet></router-outlet>
    <footer></footer>
  </div>
</div>
<div *ngIf="false">
<div class="blue">
  <router-outlet></router-outlet>
  <footer></footer>
</div>

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Build an AppComponent with a selector. Add its selector to index.html. Then add the code shown in your question to AppComponent.

This makes the bootstrapping process easier because there is only one component (AppComponent) that needs to be bootstrapped and used in index.html.

over 4 years ago · Santiago Trujillo Denunciar
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