I'm trying to use angular's ngIf to check what the title of my mat-panel box is before applying some changes to the content.
<mat-expansion-panel-header id="head">
<mat-panel-title>
Demo1
</mat-panel-title>
<img class="panel-image" src="assets/demo.png">
</mat-expansion-panel-header>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header id="head">
<mat-panel-title>
Demo
</mat-panel-title>
<img class="panel-image" src="assets/demo.png">
</mat-expansion-panel-header>
<div class="holder">
<mat-card id="CARDBOX" *ngFor="let box of box">
<img class="logoy" src="{{box.image}}" alt="Tesla" height=35px>
<a href="{{box.link}}" class="button">{{box.button_name}}</a>
<input type="image" id="info" title="Click for description" src="{{box.info}}" (click)="openDialog()" height=20px/>
</mat-card>
</mat-expansion-panel>
<mat-expansion-panel-header id="head">
<mat-panel-title>
Demo2
</mat-panel-title>
<img class="panel-image" src="assets/demo.png">
</mat-expansion-panel-header>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header id="head">
<mat-panel-title>
Demo
</mat-panel-title>
<img class="panel-image" src="assets/demo.png">
</mat-expansion-panel-header>
<div class="holder">
<mat-card id="CARDBOX" *ngFor="let box of box2">
<img class="logoy" src="{{box.image}}" alt="Tesla" height=35px>
<a href="{{box.link}}" class="button">{{box.button_name}}</a>
<input type="image" id="info" title="Click for description" src="{{box.info}}" (click)="openDialog()" height=20px/>
</mat-card>
</mat-expansion-panel>
Since I want headers to be generated by ngFor, is there is a way that I can check which header is which using ngIf before generating the body content of the panel? Like
<ngIf title===Demo>
<mat-card **apply this**/>
The reason I want to do this is because I want to generate both the headers and the content using ngFor. The headers can be generated in the same way, but the content is very different so it needs to check which header it is being placed under. Is this possible using ngIf?
I guess what I'm trying to do is like an if statement in python or java. I want it IF the title is one thing, then populate the content with something. IF the title is something else, then populate the content with something else. Does that make sense?