I am using the following configuration for my router:
var Router = Backbone.Router.extend({
routes: {
'item/:param(/:param-2)': 'func1',
// Default
'*actions': 'defaultAction'
}
});
I initialize the router as follows:
var router = new Router;
router.on('route:func1', function(param1, param2){
console.log("Route: summary, class_id: " + class_id);
});
But only URLs of the format #item/1 are matched by the func1 route.
URLs like #item/1/3 are passed to the defaultAction route.
I'm not able to figure out why the optional parameter doesn't get matched.