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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -