ember.js - How to access another controller's action from another controller -
i have upgraded ember application newest version, while testing functionality, actions doesn't work. previous code working fine in older version below.
export default ember.controller.extend({ needs: 'sales-order', actions: { showmodal: function(mode){ this.get('controllers.sales-order').send('showmodal', mode); } } });
looks "needs" depreciated.
instead of needs
should use ember.inject.controller. should this:
export default ember.controller.extend({ salesorder: ember.inject.controller(), actions: { showmodal(mode) { this.get('salesorder').send('showmodal', mode); } } });
you can find more information in managing dependencies between controllers guide.
Comments
Post a Comment