-
Notifications
You must be signed in to change notification settings - Fork 418
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
Clarify how to declare multi-word controller names in docs #62
Comments
Thank you for the feedback! We do have the webpack filename-to-identifier mapping documented, but I agree it’s not at all obvious. I’d like to see if we can work this into the Handbook. |
Oh snap! Sorry about that, I totally missed that. Cool deal! 👍
… On Jan 18, 2018, at 7:27 PM, Sam Stephenson ***@***.***> wrote:
Thank you for the feedback! We do have the webpack filename-to-identifier mapping documented, but I agree it’s not at all obvious. I’d like to see if we can work this into the Handbook.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Had the same issue with camelCased data attributes for the Data API after the Stimulus render; of course I forgot my HTML5 training, but it may not be obvious to those who may not understand the semantics of ex: |
Closing for now since this is documented in the installation guide and referenced in the handbook:
|
Hey @javan. As someone who is struggling a little with this right now, I'd love to help clarify it for other newcomers. Your link above 404s, and I'm struggling to find the right "vanilla" way of doing this. e.g. Using without a Build System states the following: application.register("hello", class extends Stimulus.Controller {
static get targets() {
return [ "name" ]
}
// …
}) Should the Perhaps it might be clearer if examples were two-word controllers to begin with – as it's (arguably) easier to work backwards from two words than forwards from one? Happy to help if I can. Thanks. 👍 |
@christhesoul, |
Hey @javan,
when it really should be
|
How about for values from data attributes? |
Just something you might want to add to the docs eventually. After some experimenting with trying to get a multi-word controller working. I eventually realized that it has to be separated by a
-
instead of a_
like the controller file itself needs to be named.... which points to ...
option_panel_controller.js
At first, I was putting
_
in the markup data attributes before I realized it was a dash. This might be assumed by some folks, but still might not be a bad idea to mention it in the docs or in an FAQ somewhere.I'm happy to submit a pull request for this as well but wasn't sure where or how you'd want to include this in the handbook.
Cheers :)
The text was updated successfully, but these errors were encountered: