Closed ghost closed 9 years ago
Fixed this in a different manner.
Backbone.Highway.map(function () {
this.route('user', {
path: '/user/:id',
action: function (id) { /* Render user page */ }
});
this.route('user.edit', {
path: '/user/:id/edit',
before: [
// will automatically receive user.edit route argument
'user'
// will override argument received from parrent route
{name: 'user', args: [1234]}
// here the argument gets extracted and also overrides parent route argument
{path: '/user/1234'}
],
action: function (id) { /* Render user edit page */ }
});
});
When declaring an alias to another route via its path the primary route arguments are not passed in. For example :