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, i use templ with HTMX, therefore i use hyperscript whenever possible
sometimes i want to write scripts and interpolate with values i provide from templ, however they are ALWAYS converted to string, is there a way to use plain instead of string ?
var buttonIdSelector = "#randomButtonId"
<script type="text/hyperscript">
def ClearMyButton()
set {{ randomButtonId }}.value to '' // this will convert to: set "#randomButtonId".value to '' ; instead of: set #randomButtonId.value to ''
end
</script>
is there a way to address this ? besides passing the selector as params with _={ fmt.Spring("ClearMyButton(%s)", buttonIdSelector) }
its quite inconvinient to pass 100 params when i can use them as already defined
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, i use templ with HTMX, therefore i use hyperscript whenever possible
sometimes i want to write scripts and interpolate with values i provide from templ, however they are ALWAYS converted to string, is there a way to use plain instead of string ?
is there a way to address this ? besides passing the selector as params with _={ fmt.Spring("ClearMyButton(%s)", buttonIdSelector) }
its quite inconvinient to pass 100 params when i can use them as already defined
Beta Was this translation helpful? Give feedback.
All reactions