Skip to content

Commit

Permalink
Merge pull request #320 from github/319-delimiters
Browse files Browse the repository at this point in the history
Docs: surface required delimiters for Targets' and Actions' syntax patterns
  • Loading branch information
keithamus committed Jun 29, 2024
2 parents dc284dc + 43a6b7f commit 876ec34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/_guide/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class HelloWorldElement extends HTMLElement {
The actions syntax follows a pattern of `event:controller#method`.

- `event` must be the name of a [_DOM Event_](https://developer.mozilla.org/en-US/docs/Web/Events), e.g. `click`.
- `:` is the required delimiter between the `event` and `controller`.
- `controller` must be the name of a controller ascendant to the element.
- `#` is the required delimieter between the `controller` and `method`.
- `method` (optional) must be a _public_ _method_ attached to a controller's prototype. Static methods will not work.

If method is not supplied, it will default to `handleEvent`.
Expand Down
1 change: 1 addition & 0 deletions docs/_guide/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class HelloWorldElement extends HTMLElement {
The target syntax follows a pattern of `controller.target`.

- `controller` must be the name of a controller ascendant to the element.
- `.` is the required delimiter between `controller` and `target`.
- `target` must be the name matching that of a `@target` (or `@targets`) annotated field within the Controller code.

### Multiple Targets
Expand Down

0 comments on commit 876ec34

Please sign in to comment.