I am using Ember Need Api to call a controller method in another controller. I can get an instance of the controller, but when I call its method, it returns me this error TypeError: Object [object Object] has no method.
This is what I call it:
Cards.CardsIndexController = Ember.Controller.extend({ needs: 'account_info', actions: { accountInfoStart:function(){ console.log(this.get('controllers.account_info').test());
This is the controller whose function I want to call
Cards.AccountInfoController = Ember.Controller.extend({ actions:{ test: function(){ alert(1); } } });
How can I solve it?
source share