lundi 2 mars 2015

Can't sendAction from event handler triggered by component

I've got a component sending an action:



this.sendAction('action', data.files)


In the template I used the component like this



{{file-upload url="api/v1/upload" action="finishedUpload"}}


In the controller handling the event I'd like to send another action (to the same controller but I get the infamous TypeError: undefined is not a function



finishedUpload: function(files) {
this.sendAction('insertImage')
}


How can I get the context of the current controller so I can send actions in the event-handler?





Aucun commentaire:

Enregistrer un commentaire