Skip to content

Commit 23b2b41

Browse files
authored
Merge branch 'main' into controller-manages-instance-tracking
2 parents ffe9438 + df3b6a4 commit 23b2b41

8 files changed

Lines changed: 1730 additions & 521 deletions

File tree

docs/_guide/actions.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,18 @@ The actions syntax follows a pattern of `event:controller#method`.
6767

6868
- `event` must be the name of a [_DOM Event_](https://developer.mozilla.org/en-US/docs/Web/Events), e.g. `click`.
6969
- `controller` must be the name of a controller ascendant to the element.
70-
- `method` must be a _public_ _method_ attached to a controller's prototype. Static methods will not work.
70+
- `method` (optional) must be a _public_ _method_ attached to a controller's prototype. Static methods will not work.
71+
72+
If method is not supplied, it will default to `handleEvent`.
73+
74+
Some examples of Actions Syntax:
75+
76+
- `click:my-element#foo` -> `click` events will call `foo` on `my-element` elements.
77+
- `submit:my-element#foo` -> `submit` events will call `foo` on `my-element` elements.
78+
- `click:user-list` -> `click` events will call `handleEvent` on `user-list` elements.
79+
- `click:user-list#` -> `click` events will call `handleEvent` on `user-list` elements.
80+
- `click:top-header-user-profile#` -> `click` events will call `handleEvent` on `top-header-user-profile` elements.
81+
- `nav:keydown:user-list` -> `navigation:keydown` events will call `handleEvent` on `user-list` elements.
7182

7283
### Multiple Actions
7384

0 commit comments

Comments
 (0)