Home > Blockchain >  Condition inside string is not working - angular
Condition inside string is not working - angular

Time:11-26

I want to show a different icon depending on the if my value is true or false

<span><i class="fas fa-caret-" ({{ extendedOptionsContainer ? "down" : "up" }}) "></i></span>

So if extendedOptionsContainer is true, icon will be down, and if its not it will be up, but this wont work because inside this string and "", any help?

CodePudding user response:

  <span><i [ngClass]="'fas fa-caret-'   (extendedOptionsContainer ? 'down' : 'up')"></i></span>
  • Related