2014-02-27 29 views
0

返回的JSON是預期的,但是當我console.log響應我得到這個瘋狂的結構,似乎永遠持續下去。我的每個模型都獲得了它本身所屬的確切集合的集合。究竟是怎麼回事?爲什麼我的收藏中的每個模型都有一個集合?

繼承人的代碼與IM

 this.reporterCollection.fetch({ 
      success: _.bind(function(response){ 
       console.log("response"); 
       console.log(response); 
       this.addChildView(new DirectReportListView({collection: response, supervisor: this.searchAlias, projectId: this.options.projectId}).render(), $("#testModalDiv")); 
      }, this) 
     }); 

忽略的觀點的東西調用它,在日誌行之前出現問題。

enter image description here

回答

0

這是正常的,集合中的每個modelcollection場指向包含它的collection

model.collection屬性通常在您首次將模型添加到集合時自動創建。

Documentation

+0

謝謝,我知道它只是一個指針現在,我認爲模式實際上是包含自身的集合。 – lorless

相關問題