【发布时间】:2015-10-22 21:11:49
【问题描述】:
我试图从路由中调用控制器动作。
setupController(controller, model) {
controller.set('model', model);
//controller.send('showInvite');
controller.send('switchTabByName',model.get('name'));
if(!this.get('state.user.hasCopiedInviteLink')) {
controller.send('showInvite');
}
但我无法获得“publish.continue 没有处理“switchTabByName”操作。”
我尝试直接调用方法而不进行操作,但也没有成功。我怎样才能做到这一点?
这是我在控制器中的操作块
actions: {
switchTabByName(tabName){
//console.log('Will switch to tab ',tabName);
let tab = this.get('tabs').find((item)=> {return item.get('name')===tabName; } );
this.switchTab(tab);
},
【问题讨论】:
标签: ember.js