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

126
Views
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 answers
Answer question

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 Report
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!