I have recently started learning Angular2.
I want to know if there is a possibility to use ngSwitch or ngIf angular2
directives for a specific numeric range?
Say I want to update the color of some text based on a range.
<25 = Mark the text in red
>25 && <75 = Mark the text in orange
>75 = Mark the text in green
How do I achieve the same using Angular2 ngIf/ngSwitch directives.
Is there a way something to write like this ?
<div [ngIf]="item.status < 25">
<h2 class="text-red">{{item.status}}</h2>
</div>
<div [ngIf]="item.status > 25 && item.status < 75">
<h2 class="headline text-orange">{{item.status}}</h2>
</div>
<div [ngIf]="item.status > 75">
<h2 class="headline text-green">{{item.status}}</h2>
</div>
Or anything that would have to do with using ngSwitch, ngSwitchWhen statements.