How to correctly select dynamic element id from Dynamic Attribute?

In this example, I want to implement ternary operation under dmx-text of repeat checkbox. When the checkbox is checked, I want to display True onto the label, else, False.

<input
class="custom-control-input" type="checkbox"
value="" dmx-bind:id="item_{{$index}}"
dmx-bind:name="item[{{$index}}][switch]">

<label
class="custom-control-label"
dmx-bind:for="item_{{$index}}"
dmx-text="item_1.checked ? 'True' : 'False'"> </label>

How to properly fix the above code?

Community Page
Last updated: