From f16a4439d920573bcc76422c28ae1720468161c9 Mon Sep 17 00:00:00 2001 From: William Li Date: Wed, 8 Jun 2016 06:59:45 -0700 Subject: [PATCH] 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. --- src/util/events.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/events.ts b/src/util/events.ts index 9f81bf660f..27a77c688b 100644 --- a/src/util/events.ts +++ b/src/util/events.ts @@ -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]); * }); * * ```