I am trying to learn BackboneJS and this is the error that I am getting.
I am coding in coffeescript and this is the generated JS I have no idea why this is happening as I think that I am doing it correctly.
(function() {
var AppRouter, MenuItemDetails, app;
MenuItemDetails = Backbone.View.extend({
render: function() {
var markup;
markup = "<div>" + this.options.category + "</div>";
this.$el.html(markup);
return this;
}
});
AppRouter = Backbone.Router.extend({
routes: {
"": "list",
"menu-items/new": "itemForm",
"menu-items/:item": "itemDetails"
},
list: function() {
return $('#app').html('List Screen');
},
itemDetails: function(item) {
var view;
view = new MenuItemDetails({
name: item,
category: 'Entree',
imagepath: 'no-image.jpg'
});
return $('#app').html(view.render().el);
},
itemForm: function() {
return $('#app').html("New item form");
}
});
app = new AppRouter();
Backbone.history.start();
}).call(this);
/*
//@ sourceMappingURL=app.map
*/
Where am I going wrong?