Backbone + Firebase Collection
Backbone + Firebase Collection
我正在构建一个小应用程序,但无法弄清楚为什么在尝试添加到 collection 时出现错误。这是代码:
var PollCollection = Backbone.Firebase.Collection.extend({
model: Poll,
url: 'https://***.firebaseio.com/polls',
});
var Poll = Backbone.Model.extend({
defaults: {
title: 'title',
}
});
var pollCollection = new PollCollection();
pollCollection.create({title: "test"});
有什么想法吗?谢谢!
如果我将模型移到集合上方,一切正常
我正在构建一个小应用程序,但无法弄清楚为什么在尝试添加到 collection 时出现错误。这是代码:
var PollCollection = Backbone.Firebase.Collection.extend({
model: Poll,
url: 'https://***.firebaseio.com/polls',
});
var Poll = Backbone.Model.extend({
defaults: {
title: 'title',
}
});
var pollCollection = new PollCollection();
pollCollection.create({title: "test"});
有什么想法吗?谢谢!
如果我将模型移到集合上方,一切正常