2015-04-04 20 views
3

我有一個相當標準ember.js組件:ember.js組件的屬性錯誤出與「類型錯誤:‘在’運營商不能使用搜索‘isEditing’未定義」

{{#wiki/wiki-field isEditing=isEditing fieldText=summary maxLength=2800}}     
    Summary 
{{/wiki/wiki-field}} 

它error'ing出:

Uncaught TypeError: Cannot use 'in' operator to search for 'isEditing' in undefined

看來,這是示數出搜索的關鍵字視圖中isEditing:(這是ember.debug.js行)

} else if (key in this.view._keywords) { 

這似乎沒有什麼特別的特別之處,這就是爲什麼我很激動,我找不到任何關於它的事情。我正在使用ember-cli,在pod中配置我的模塊。

組件被容納在:

  • 組件/維基/維基場/ template.hbs
  • 組件/維基/維基場/ component.coffee

回答

10

你發生要像下面調用init?

export default Ember.Component.extend({ 
    init: function(){ 
    //do stuff here... 
    }, 

如果是這樣,請確保您正在調用this._super();在你的init調用中的某個時間點。

export default Ember.Component.extend({ 
init: function(){ 
    //do stuff here.. 
    this._super(); 
    //do stuff here... 
}, 

如果情況並非如此,請發佈您的代碼。

相關問題