Variable / String Interpolation?

Hi there I wanna display an HTML element given a condition… the only available options I have is use the actual condition with dmx-show

Now my question is, is there a way to interpolate strings or do class binding like e.g. <i class="fa fa-{{gender == 2 ? 'male' : 'female'}}"></i>

the only possibility is to do this and I don’t like it:

<i class="fa fa-female" dmx-show="gender == 3"></i>
<i class="fa fa-male" dmx-show="gender == 2"></i>
<i class="fa fa-user" dmx-show="gender == 4"></i>

It looks horrible on my source code and I’m a fellow servant of the DRY principle.

Community Page
Last updated: