qp90rq
Last Updated: February 25, 2016
·
4.199K
· billeisenhauer
Ca9cc28e25f5639190a5ca05b3036248

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

Say Thanks
Respond