Question About Target Naming Convention in Stimulus #804
Closed
Maxlemore97
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I’m new to Stimulus, so apologies if this question seems a bit basic.
It seems like there’s a clear naming convention for controllers and actions:
1. data-controller="controllerName"
2. data-action="action->controllerName#methodName"
Following this logic, I would have expected targets to follow a similar convention, like data-target="controllerName#targetName". Why is this not the case?
If the conflict with Bootstrap was the issue, could we not have simply used a different attribute name, such as:
1. data-origin="controllerName#originName"
2. data-element="controllerName#elementName"
Regardless, I want to thank you for creating such an amazing library and for all the hard work you’ve put into it!
Best regards,
Max
I see how the convention used for controllers and actions wouldn’t work for values and classes. I think that answers my question.
Beta Was this translation helpful? Give feedback.
All reactions