-
-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spread JS event map #612
Comments
I have a PR open that adds support for ComponentScripts within the templ.Attributes. There hasn't been much action for review, but with more interest in the feature maybe it can move over the line. |
Nice. I would say it is still not the best interface since my go to would be to use go syntax but a solution at least and also the "basis" since attributes is like the barebones option. |
I'm going to close this issue for now as script templates are deprecated, we are looking into creating examples of better ways to interact with js in templ, which will hopefully make your use cases easier to implement. |
Why is it deprecated? I am actually using it quite a lot. The idea now is to substitute by the script tags, sure works about the same but think about a button onclick for example, it is easier to set through a ComponentScript. Do you have an issue related to this deprecation I could read? |
The deprecation itself happened under #739 |
Sorry in advance in case I have missed an issue related to this.
There are cases where a
map[string]templ.ComponentScript
might make sense but spreading or iterating is not possible on the attributes side. Tried to do a spread withtempl.Attributes
but those are not templ scripts so it makes sense that they do not work.Example A (spread):
Example B (for):
Personally I think it would be better to support a
for
under attributes. Also, afor
even fortempl.Attributes
would be interesting.The text was updated successfully, but these errors were encountered: