I have "md-grid-list" to display cards in the grid. I am looping my array of data using "ngFor". How to compare each of the datetime element in the array with the given DateTime using "ngIf"? and if the condition passes successfully, the color of the card to be set to green and if the condition is not satisfied, the color of the card is set to different color.
<md-grid-list cols="4" rowHeight="250px" gutterSize="20px">
<md-grid-tile *ngFor="let data of mydata" >
<div *ngIf="(data.myDatetime | date:'HH:mm:ss, MMMM dd') < (myCurrentDateTime |date:'HH:mm:ss, MMMM dd')">
<md-card [style.background]="'red'" [style.minHeight]="'100%'">
<md-card-title></md-card-title>
<md-card-title></md-card-title>
<md-card-content>
<h2>
</h2>
</md-card-content>
</md-card>
</div>
</md-grid-tile>
</md-grid-list>