-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Description
Short description of the problem:
Events.publish passes all arguments as first argument of subscriber :
https://github.com/driftyco/ionic/blob/master/src/util/events.ts#L99
What behavior are you expecting?
Arguments should be passed as arguments into subscriber
import { Events } from 'ionic-angular'
const events = new Events()
events.subscribe('test', function(error) {
// actual (all arguments passed as first argument of subscriber)
console.log(error); // [Error(), 1]
// expected (all arguments passed as arguments of subscriber)
console.log(error); // Error()
})
events.publish('test', new Error('test'), 1)
Other information:
Basically https://github.com/driftyco/ionic/blob/master/src/util/events.ts#L99 line should be changed to:
responses.push(handler(...args));Which Ionic Version? 1.x or 2.x
2.x
Metadata
Metadata
Assignees
Labels
No labels