Currently, I am utilizing Angular to control the visibility of different divs using the ngIf feature. Below is an example of what I have implemented:
.html
<div class="boxes">
<div class="box" (click)="tabToggle(1)">box1</div>
<div class="box" (click)="tabToggle(2)">box2</div>
<div class="box" (click)="tabToggle(3)">box3</div>
<div class="box" (click)="tabToggle(4)">box4</div>
<div class="box" (click)="tabToggle(5)">box5</div>
</div>
<div *ngIf="showTab == 1" class="box1-content">Lorem ipsum 1</div>
<div *ngIf="showTab == 2" class="box2-content">Lorem ipsum 2</div>
<div *ngIf="showTab == 3" class="box3-content">Lorem ipsum 3</div>
<div *ngIf="showTab == 4" class="box4-content">Lorem ipsum 4</div>
<div *ngIf="showTab == 5" class="box5-content">Lorem ipsum 5</div>
For more information check out this live link: https://stackblitz.com/edit/angular-8reazh?embed=1&file=src/app/app.component.ts
I am exploring ways to add a specific class to the currently selected "box" element. For instance, highlighting the selected box with a blue background while reverting the previous selection back to red when clicking on another box.