I am wrapping a jQuery plugin into a component. This plugin listens for a custom event to trigger an action.
The problem is that when I call my action the parameter received is the jQuery event instead of the parameters I am passing in the handlebars helper action.
How can I get this parameter on the action.
Below my code:
common/confirmation-button.js
export default Ember.Component.extend({
tagName: "button",
classNameBindings: ['btn-class'],
didInsertElement() {
this._super(...arguments);
if (this.get('onConfirm')){
//jQuery implementation
this.$().on('confirmed.bs.confirmation', this.get('onConfirm'));
}
}
});
parent-view.hbs
...
{#common/confirmation-button onConfirm=(action 'confirmDelete' account.id)}}
Delete account
{{/common/confirmation-button}}
parent-component.js
export default Ember.Component.extend({
account: Ember.computed.alias('model.account_info'),
actions:{
confirmDelete(id){
// I WANT TO ACCESS TO PARAMETERS HERE
console.log(id)//jQuery event
}
}
});
Thanks in advance