i'm trying to get my feet wet with Backbone, but I can't figure out what's wrong here:
var ToDoApp = {
model: Backbone.Model.extend({
default:function(){
return {
task: '',
completed:false
}
}
}),
collection: Backbone.Collection.extend({
model: this.model
}),
view: Backbone.View.extend({
model: new this.model(),
tagName: 'li'
})
}
console.log(new ToDoApp.model());
I get an 'undefined is not a function' on the model for the view. What's going on?
Also, does the view even need to have a model there? Sorry if that's a really basic question, I still don't quite understand fully how backbone works.