내가 내보기이 방법을 나던 :컬렉션
var TryView = Backbone.View.extend({
initialize: function(){
this.render();
},
render: function(){
var test = this.collection.get(0);
this.collection.each(function(model){
document.write(model.id+"<br>");
});
}
을});
및 기존 (작업 중) 일부 컬렉션으로 생성하려면.
var testView = new TryView({collection: test.TestCollection});
하지만 난 오류 얻을 : 가져
Object function(){ parent.apply(this, arguments); } has no method 'get'
과와 같은
어디에서 test.TestCollection을 할당합니까? TestCollection은 Backbone 컬렉션 대신 함수입니다. –