Can I use multiple routers in backbone.js
, that don't interfere with each other route-wise, without any issues? Or is there something that I should be concerned about?
Code sample:
myapp.routers.main = Backbone.Router.extend({
routes : { "": "index" },
index : function() { console.log("routed by main router");}
});
myapp.routers.another = Backbone.Router.extend({
routes : { "notmain": "index" },
index : function() { console.log("routed by another router");}
});
mainrouter = new vaikava.routers.main;
notmainrouter = new vaikava.routers.another;
Backbone.history.start();