I am reading a java object on an sightly template and I have a js server-side.
I am trying to compare a value from this js server-side with a value of my java list.
When I print the compare on my page it evaluates as true, but when I put this same code inside a data-sly-test, the value seems not true as the code inside is not executed, but I am printing out this condition and is true. My code:
From the snippet pasted in your original post, could observe a "." after data-sly-test. Not sure if it is a typo here or in the code taken from your HTL. If it is not typo in your actual HTL, then try doing the below
Capture the comparison value and then proceed further: