Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

124
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda