Я пытаюсь вызвать действие моего контроллера с моей точки зрения с Эмбер, но он говорит:Ember Просмотр не находя контроллер/действие
Uncaught TypeError: Cannot call method 'send' of null
Я просто не могу найти правильный способ работы с видом в ember.
Моя раскладка вид имеет вызов, как:
<button type="button" {{action modalConfirmation target="view"}} class="btn btn-primary">Save changes</button>
И мой взгляд класс пытается вызвать контроллер таким образом:
this.get('controller').modalConfirmation();
My Controller имеет что-то вроде этого:
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