0
나는 여기서 학습 곡선을 그리며 내 질문에 사소한 생각이들 때 나를 용서합니다. 백본에서 컬렉션을 만들려고합니다. 문제는 console.log teamGroup 컬렉션을하려고하면 정의되지 않은 오류가 발생합니다. 이런 일이 일어나는 이유는 무엇입니까?정의되지 않은 오류가 발생하는 Backbone.js 모음 만들기
var team = Backbone.Model.extend({
defaults : {
name: "",
role: "",
bio: "",
link: "",
media: ""
}
});
//Create a collection template that references which model to base it on
var teamCollection = Backbone.Collection.extend({
model: team
});
//Create model instances for each team member
var teamPayal = new team({
name: "P Seth",
role: "Director",
bio: "Director PS is from Hyberadad.",
link: "www.filmschool.com",
media: "www.facebook.com"
});
var teamUnio = new team({
name: "Unio Guiterrez",
role: "Producer",
bio: "Unio is a producer from SF",
link: "www.greengeender.com",
media: "www.twitter.com/unio"
});
var teamScott = new team({
name: "Scott Baskovich",
role: "Musician",
bio: "Scott is a musician from SF",
link: "www.music.com",
media: "www.linkedin.com"
});
//Create new collection for the team
var teamGroup = teamCollection([
teamPayal, teamUnio, teamScott
]);
console.log(teamGroup.toJSON());
</script>
오! 그것은 트릭을했다. 많은 감사합니다! – Toshi