I am trying to sort out how to accomplish this. I have a button group that gets generated in an ngFor loop:
<div class="btn-group float-right">
<button *ngFor="let frequency of mapping?.frequency_mapping" [ngClass]="[profile?.frequency_name == frequency.label ? 'btn-success' : 'btn-outline-secondary']" type="button" value="{{ frequency.pk}}" class="btn">{{ frequency.label }}</button>
</div>
and where i add the text for the button, I would like to insert a class based on the value of this button's frequency.label
so something like this:
if frequency.label = condition A then class = classA
else if frequency.label = condition B then class = classB
else if frequency.label = condition C then class = classB
what would the best way to accomplish this?
basically i need the end result to be something like
<button><i class="fa fa-classA"></i>{{ frequency.label }}</button>
<button><i class="fa fa-classB"></i>{{ frequency.label }}</button>
<button><i class="fa fa-classC"></i>{{ frequency.label }}</button>