I was trying to do dynamically change icon based on the value which is there in span
Here is my HTML actually in the version text there only two values will come
- Active if it is active success icon should come
- InActive if it is inactive Warning icon should come
I am not sure how to use ngclass here to get the value.
<div class="pl-2">
<div class="version-box">
<i class="fa fa-check-circle text-warning ml-1"></i>
<i class="fa fa-check-circle text-success ml-1"></i>
<span class="version-label">{{selectedVersion.versionText}}</span></div>
</div>
Please let me know how to bring that
<i class="fa fa-check-circle ml-1" [ngClass]="{selectedVersion.versionText == 'Active' ? 'text-warning': 'text-success' }"></i>- Rahul Raveendran<span *ngIf="selectedVersion.versionText == 'Active' "> <i class="fa fa-check-circle text-warning ml-1"></i> </span>- Rahul Raveendran