Skip to content

Commit f3e1c03

Browse files
authored
Add clarifying example for camelCase targets (#577)
1 parent 7b90498 commit f3e1c03

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/reference/targets.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,15 @@ with a matching name, the corresponding callback _will not_ be invoked again.
121121

122122
## Naming Conventions
123123

124-
Always use camelCase to specify target names, since they map directly to properties on your controller.
124+
Always use camelCase to specify target names, since they map directly to properties on your controller:
125+
126+
```html
127+
<span data-search-target="camelCase" />
128+
<span data-search-target="do-not-do-this" />
129+
```
130+
131+
```js
132+
export default class extends Controller {
133+
static targets = [ "camelCase" ]
134+
}
135+
```

0 commit comments

Comments
 (0)