Backbone.Router component
$ component install spini/backbone-router
It provides Router.history
instead of Backbone.history
var Router = require('spini-backbone-router');
var Workspace = Router.extend({
routes: {
"help": "help", // #help
"search/:query": "search", // #search/kiwis
"search/:query/p:page": "search" // #search/kiwis/p7
},
help: function() {
...
},
search: function(query, page) {
...
}
});
var myrouter = new Router(options);
Router.history.start({pushState: true});
// or
Router.history.start();
See documentation for Backbone.Router