-
-
Notifications
You must be signed in to change notification settings - Fork 325
Closed as not planned
Description
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 with templ.Attributes
but those are not templ scripts so it makes sense that they do not work.
jsMap := map[string]templ.ComponentScript{
"onclick": alert(),
}
Example A (spread):
<button { jsMap... }>Foo</button>
Example B (for):
<button
for evt, fn := range jsMap {
{evt}={fn}
}
>Foo</button>
Personally I think it would be better to support a for
under attributes. Also, a for
even for templ.Attributes
would be interesting.
Metadata
Metadata
Assignees
Labels
No labels