mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
docs(events): clean up confusion with Event arguments
Addresses part of https://github.com/driftyco/ionic-site/issues/544. This PR makes it so that the piece of code in the docs works as intended. Otherwise, the second console.log statement will result in an array output, instead of the intended user object.
This commit is contained in:
@ -17,8 +17,9 @@
|
||||
* }
|
||||
*
|
||||
* // second page (listen for the user created event)
|
||||
* events.subscribe('user:created', (user) => {
|
||||
* console.log('Welcome', user);
|
||||
* events.subscribe('user:created', (userEventData) => {
|
||||
* // userEventData is an array of parameters, so grab our first and only arg
|
||||
* console.log('Welcome', userEventData[0]);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
|
Reference in New Issue
Block a user