I am new to Backbone.js. For experimenting / initial development, I had everything on one page in the tag, but I started separating out the code into a separate .js file. After I did that I get an error coming from the Router.
Uncaught TypeError: Object [object Object] has no method 'apply'
Here is my Router code:
var AppRouter = new Backbone.Router.extend({
routes: {
":uuid": "details"
},
details: function (uuid) {
// load details
new DetailView({id: uuid, el: $('#detailView')});
}
});
var appRouter = new AppRouter;
I have the Models/Views loaded in a file tag above, but even if I comment out the file's tag or empty the file, it still displays thing error.
The line throwing the error is var appRouter = new AppRouter;
I'm I doing something wrong with the router code.
Thanks!! Andrew
newinvar AppRouter = new Backbone.Router.extend({...var AppRouter = new Backbone.Router.extend({tovar AppRouter = Backbone.Router.extend({and changevar appRouter = new AppRouter;tovar appRouter = new AppRouter();