Ember-pre4 helper not passing browser event?
Hi I have the following code in my template:
<div {{action "play" this target="view"}}>{{title}}</div>
and the following code in my opinion:
MB3.PlaylistView = Ember.View.extend({
play: function(event) {
}
});
the parameter event passed to the play function is now a playlist model (passed as "this" in the above action example)
In Ember-pre2, a parameter passed to an action handler received a browser event with attributes like currentTarget
etc and the property context that the model was in.
How can I access parameters like currentTarget
in ember-pre4?
source to share
This ticket also discusses a lot:
https://github.com/emberjs/ember.js/issues/1684
The recommended solution would be to create a custom view and then define a click handler. The click handler will be passed to the event as the first argument.
MB3.PlayButtonView = Em.View.extend({
click: function(event){
... click handler
}
});
source to share
this is by intent but there is an improvement issue for this, see https://github.com/emberjs/ember.js/issues/1986
source to share