You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello and thank you so much for this wonderful language!
Hyperscript completely solves all my tasks on the front end, with the exception of a small problem: SET command in the template's loop doesn't work.
The code from the example of using templates does not work:
<template id="color-template">
<ul>
@repeat in colors
@set bg to it -- this command return lenght of it, but not it as Object
@set fg to getContrastingColor(it) -- the same problem
<li style="background: ${bg}; color: ${unescaped fg}">${bg}</li>
@end
</ul>
</template>
And this code works:
<template id="color-template">
@repeat in colors
<li style="background: ${it}; color: ${getContrastingColor(it)}">${it}</li>
@end
</template>
I found a workaround: using loops directly in DOM elements (when more complex logic is required). I'm not very versed in JavaScript (that's why I chose Hyperscript) to send the pull request, but I hope that this bug causes inconvenience to someone else and it can be fixed.
The text was updated successfully, but these errors were encountered:
Hello and thank you so much for this wonderful language!
Hyperscript completely solves all my tasks on the front end, with the exception of a small problem: SET command in the template's loop doesn't work.
The code from the example of using templates does not work:
And this code works:
I found a workaround: using loops directly in DOM elements (when more complex logic is required). I'm not very versed in JavaScript (that's why I chose Hyperscript) to send the pull request, but I hope that this bug causes inconvenience to someone else and it can be fixed.
The text was updated successfully, but these errors were encountered: