I have a controller A that sent an action with this.send('makeItHappen'), and I want to handle it in controller B. How do I do it?
JS:
// Controller A
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
sendToDataCenter() {
this.send('makeItHappen');
}
}
});
// Controller B
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
makeItHappen() {
console.log('It works!!'); // this throws an error
}
}
});
In Controller B, it throws an error: Uncaught Error: Nothing handled the action 'makeItHappen'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.
Please, can anyone help? Thank you.
Aucun commentaire:
Enregistrer un commentaire