Simple question, cannot seem to find an answer... (this will be a quick 'point' for someone)
I'm looking to have a condition in an Angular 5 ngIf be "less than" some variable.
<div class="row" *ngIf="Subject < 4" >
<div class="row" *ngIf="Subject <= 4" >
this syntax bombs because "<" - how can I do this? (without having to write function)?
*ngIf doesn't work with '<=' sign. Need to check equal(==), less than(<) and greater than(>) conditions separately with OR operator. Some IDE might show '<' or '>' sign in as syntax error while writing the code, because these are used for HTML tags also. But, it will not throw any compile or run time error.
<div class="row" *ngIf="4 > Subject">
<div class="row" *ngIf="4 >= Subject">
And you're done Works perfect for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With