I'm in a situation where I have the following:
class App.Routers.SuperRouter extends Backbone.SubRoute
createTrailingSlashRoutes: true
...
from which I extend:
class App.Routers.Books extends App.Routers.SuperRouter
...
I've noticed that the createTrailingSlashRoutes: true instance property is applied to neither App.Routers.SuperRouter nor the routers extending from it. This appears to be the result of backbone.subroute.js line 38:
this.createTrailingSlashRoutes = options && options.createTrailingSlashRoutes;
indicating that the createTrailingSlashRoutes option must be supplied to the router when it's instantiated. It looks like this would be a simple change:
this.createTrailingSlashRoutes ||= options && options.createTrailingSlashRoutes;
and I would like to know wether this is worth doing before I go through the process of throwing together a PR. For the time being I am supplying my own constructor:
class App.Routers.SuperRouter extends Backbone.SubRoute
constructor: (route, opts = {}) ->
super(route, _.extend opts, { createTrailingSlashRoutes: true })
...
Let me know your thoughts when you've got a moment - thanks!