I recently started using Angular and I am facing a challenge with my 2-page setup. On the first page, there is a list of main category icons displayed. I would like to show the subcategory icons on the next page based on the selected main category. For example, if I click on "Food," then on the next page, the subcategories related to food should be displayed. The same applies to categories like Salon, Spa, etc. Below is the code snippet for your reference. Any suggestions on how I can achieve this would be greatly appreciated.
dashboard.component.html
<div class="productBlock">
<div class="container" style="text-align:-webkit-center">
<div>
<owl-carousel [options]="{items:5, dots:true, navigation:true}"
[carouselClasses]="['owl-theme', 'row', 'sliding','prev' , 'next']">
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/food.png" (click)="productListItemClick()" alt=""></div><span>Food</span></a>
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/activities.png" (click)="productListItemClick()" alt=""></div><span>Activities</span></a>
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/fitness.png" (click)="productListItemClick()" alt=""></div><span>Fitness</span></a>
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/salon.png" (click)="productListItemClick()" alt=""></div><span>Salon</span></a>
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/spa.png" (click)="productListItemClick()" alt=""></div><span>Spa</span></a>
</owl-carousel>
</div>
</div>
</div>
dashboard.component.ts
productListItemClick()
{
this.router.navigate(['/deals']);
}
deals-list.component.html
<div class="productBlock">
<div class="container" style="text-align:-webkit-center">
<div *ngIf="food">
<owl-carousel [options]="{items:2, dots:true, navigation:true}"
[carouselClasses]="['owl-theme', 'row', 'sliding','prev' , 'next']">
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/cafes.png" alt=""></div><span>Cafes</span></a>
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/desserts.png" alt=""></div><span>Desserts</span></a>
</owl-carousel>
</div>
<div *ngIf="spa">
<owl-carousel [options]="{items:2, dots:true, navigation:true}"
[carouselClasses]="['owl-theme', 'row', 'sliding','prev' , 'next']">
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/body.png" alt=""></div><span>Body</span></a>
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/ayurvedic.png" alt=""></div><span>Ayurvedic</span></a>
</owl-carousel>
</div>
<div *ngIf="salon">
<owl-carousel [options]="{items:2, dots:true, navigation:true}"
[carouselClasses]="['owl-theme', 'row', 'sliding','prev' , 'next']">
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/hair.png" alt=""></div><span>Hair Care</span></a>
<a class="product-single"><div><img style="width: 60px; height: 60px;" src="assets/images/makeup.png" alt=""></div><span>Makeup</span></a>
</owl-carousel>
</div>
</div>
</div>