0
려고 찾을 수 없습니다 수는 nodeController:startEditing
에서, 나는 다음과 같은 문제를 얻을 nodeEditController
: 컨트롤러가 정의되어 있지만,
Uncaught TypeError: Cannot call method 'set' of undefined
이
은NodeController
입니다 :
SettingsApp.NodeController = Ember.ObjectController.extend({
isEditing: false,
startEditing: function() {
debugger;
var nodeEditController = this.get('controllers.nodeEdit');
nodeEditController.set('content', this.get('content'));
nodeEditController.startEditing();
this.set('isEditing', true);
},
...
이는 NodeEditController
입니다 :
SettingsApp.NodeEditController = Ember.ObjectController.extend({
needs: ['node'],
startEditing: function() {
//debugger;
// add the contact and its associated phone numbers to a local transaction
var node = this.get('content');
var transaction = node.get('store').transaction();
transaction.add(node);
// contact.get('phones').forEach(function (phone) {
// transaction.add(phone);
// });
this.transaction = transaction;
},
...
오류가 발생합니다. N 라인 :
nodeEditController.set('content', this.get('content'));
때문에 :
var nodeEditController = this.get('controllers.nodeEdit');
반환 undefined
. 왜 그런가요? NodeEditController
이 정의되었습니다!
! 이제 작동합니다. 가능한 한 빨리 받아 들인다 ... – dangonfast