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

207
Visualizações
The template of app-root component is not repeating upon multiple references of app-root tag in index.html

I have generated the base Angular application using angular-cli and the application is loading fine. Then I have repeated app-root in index.html but surprisingly the app-root component template is not visible twice, the template is displayed only once. Even if I refer app-root component multiple times, the template is appearing only once. Below is my code.

<body>
  <app-root></app-root>
  <app-root></app-root>
</body>

However I can see the multiple app-root tags in the Elements section while inspecting through chrome developer tools. Why the template of app-root is not getting repeated as many times as I refer app-root tag in index.html file?

Inspect Elements

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

That app-root component is your root bootstrap component so mentioning it multiple times is not gonna do anything, angular will look for first reference of app-root in html and will treat it as starting point of your application.

about 4 years ago · Juan Pablo Isaza 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