I want to be able to set the color of the tab according to a condition like i'm doing on the div in the provided stackblitz project with the content class. If the selectedMarketStatus === marketStatus.Open
statement is true i want both the content div and the tab to be green. Is this possible? If so how do i do it?
Edit: updated the blitz which kind of does what i wanted, the scss style on the &-closed does not work on stackblitz but it works in my project.
export class TabGroupThemeExample {
public marketStatus = MarketPurchaseStatus;
public selectedMarketStatus = this.marketStatus.Open;
constructor() {}
}
export enum MarketPurchaseStatus {
BeforeOpen = 0,
Open = 1,
AfterClose = 2
}
.content {
background-color: gray;
}
.open {
background-color: green;
}
<mat-tab-group class="subscription-market-tabs" [animationDuration]="0" [disableRipple]="true">
<mat-tab>
<ng-template mat-tab-label>aaaa</ng-template>
</mat-tab>
<mat-tab [disabled]="selectedMarketStatus === marketStatus.AfterClosed">
<ng-template mat-tab-label>bbbb</ng-template>
</mat-tab>
</mat-tab-group>
<div class="content" [class.open]="selectedMarketStatus === marketStatus.Open">aaaaaa</div>