lundi 26 juin 2017

Communication between components in Ember

I have a template with two components, a file upload component, and a progress bar to show the upload progress.




And am using ember-uploader. I'm trying to set the progress of the progress bar like so:

uploader.on('progress', e => {
    // send progress to other component
});

I've read that you should use actions to communicate between components, but I only have access to that progress value within the filesDidChange function in the upload component, so I don't think I can send it in an action. What is the best way to send this progress value into the progress bar component?




Aucun commentaire:

Enregistrer un commentaire