Skip to content

Commit

Permalink
Add clarifying example for camelCase targets (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
benkoshy committed Aug 30, 2022
1 parent 7b90498 commit f3e1c03
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/reference/targets.md
Expand Up @@ -121,4 +121,15 @@ with a matching name, the corresponding callback _will not_ be invoked again.

## Naming Conventions

Always use camelCase to specify target names, since they map directly to properties on your controller.
Always use camelCase to specify target names, since they map directly to properties on your controller:

```html
<span data-search-target="camelCase" />
<span data-search-target="do-not-do-this" />
```

```js
export default class extends Controller {
static targets = [ "camelCase" ]
}
```

0 comments on commit f3e1c03

Please sign in to comment.