Skip to content

Commit

Permalink
Added usage of eventPayload in the event handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
maiah committed Aug 5, 2013
1 parent 3a74f4a commit b0afba0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/base_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ this.after('initialize', function() {
});
```

Example of `handler` having the `ev` and `data` parameters that can be used
to receive data from the component's optional `trigger` parameter `eventPayload`.

```js
this.on(document, 'dataSent', function (ev, data) {
alert('Message sent: ' + data.msg);
});
```

Example of `handler` being an object that maps event targets to callbacks.
This is effectively event delegation; selector values are resolved, at event
time, by keying into the `attr` property of the component.
Expand Down

0 comments on commit b0afba0

Please sign in to comment.