Subject. Trying to do this:
var HellospaceRouter = Backbone.Router.extend({ routes: { "/": "root", "signup": "signup", "login": "login" } });
But the root router is not processed. At the docks on this subject nothing is said, alas.
Subject. Trying to do this:
var HellospaceRouter = Backbone.Router.extend({ routes: { "/": "root", "signup": "signup", "login": "login" } });
But the root router is not processed. At the docks on this subject nothing is said, alas.
The default router has an index of '' (empty string):
http://jsfiddle.net/oceog/TaCVE/
var Router = Backbone.Router.extend({ routes: { 'items/:id': 'itemDetails', '': 'root', }, itemDetails: function (id) { console.log('id: %o', id); }, root: function() { console.log('root'); } }); var router = new Router(); Backbone.history.start();
Source: https://ru.stackoverflow.com/questions/193680/
All Articles
#/
? for root can it be? - zb '