我想从我与Ember观点打电话给我的控制器的作用,但它说:灰烬查看没有找到控制器/动作
Uncaught TypeError: Cannot call method 'send' of null
我只是找不到一个享有工作权路在余烬中。
我的看法布局具有类似电话:
<button type="button" {{action modalConfirmation target="view"}} class="btn btn-primary">Save changes</button>
我的视图类试图调用控制器以这种方式:
this.get('controller').modalConfirmation();
我的控制器有这样的事情:
ProjEmber.BananasIndexController = Ember.ArrayController.extend({
actions: {
showModal: function() {
modalinaView.title = "My Title";
modalinaView.templateName = "any_template_you_wish";
modalinaView.append();
},
modalConfirmation: function() {
console.debug('Action modalConfirmation');
}
}
});
OBS:如果我使用这样的助手追加我的视图,它会有效:
{{#view ProjEmber.ModalinaView title='A title'}}
A not so good application of a modal view. Just for the sake of illustration.
{{/view}}
你可以看到在Github上完整的源代码中,especifically这部分承诺: https://github.com/lucaspottersky/ember-lab/commit/4862426b39adc0bbcce0b4cc3fd0099439f8dd55#commitcomment-4421854
当你追加被它正确地创建它的操作旁边? – Kingpin2k