我正在使用Ember的Need Api调用另一个控制器中的控制器的方法。我能够得到控制的情况下,但是当我调用它的方法,它返回我这个错误TypeError: Object [object Object] has no method.
在另一个控制器中调用控制器方法Ember
这是我特意打电话吧:
Cards.CardsIndexController = Ember.Controller.extend({
needs: 'account_info',
actions: {
accountInfoStart:function(){
console.log(this.get('controllers.account_info').test()); // error here
}
}
});
这是我想它的功能控制器致电
Cards.AccountInfoController = Ember.Controller.extend({
actions:{
test: function(){
alert(1);
}
}
});
我该如何解决?
感谢它是工作.. – mohsinali1317
对于谁需要它来工作的人与嵌套的文件夹,这里有一个解决方案:http://stackoverflow.com/a/29269015/499700 – poweratom