I am following this backbone tutorial and this require.js tutorial. I am trying to combine them.
When create an ItemListView, then I get an error
TypeError: singleItemView is not a function
model: item
My code:
define([
'jquery',
'underscore',
'backbone',
// Pull in the Collection module from above
'collections/projects',
'collections/item',
'models/projects'
], function($, _, Backbone, projectsCollection, singleItemView, itemViewModel){
var projectListView = Backbone.View.extend({
el: $("#page"),
....
....
appendItem: function(item){
var itemView = singleItemView({
model: item
});
$('ul', this.el).append(itemView.render().el);
}
How can I solve this problem?