Replies: 1 comment 7 replies
-
|
For, simplicity I wonder if purely allowing an expression as the key is the way forward? So your examples would be as follows: <input {"data-bind-"+"foo-bar"} />
<input {"data-bind-foo-bar"} />
<input {"data-bind-"+"foo-bar"}="baz" />
<input {"data-bind-foo-bar"}={"baz"} /> |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Right now you have a single
{..attrs}oftempl.Attributesavailable for dynamic attribute names. This tends to make the locality of behavior of Templ (which is so good at) get lost. Datastar for example using data-* attributes and for example binding can be done with something like<input data-bind-foo-bar />Note in this case there is no value. What I'd like is a way to have attribute names in place
<input data-bind-{"foo-bar"} /><input {"data-bind-foo-bar"} />and with values
<input data-bind-{"foo-bar"}="baz" /><input {"data-bind-foo-bar"}={"baz"} />Beta Was this translation helpful? Give feedback.
All reactions