Last Updated: February 25, 2016
·
4.738K
· billeisenhauer

Default Routes in backbone.js

Add an additional route as the last route in your router:

'*path':  'defaultRoute'

and then handle it like this:

defaultRoute: function(path) {
    this.doSomething();
}

This works since Backbone.js will match the routes in order, but will always match the 'splat' route.

http://stackoverflow.com/questions/6088073/default-routes-in-a-backbone-js-controller