I'm working with Backbone.js using Backbone Boilerplate and what I'm looking for is a way to pass an id of a dynamic route into the view. So the view can download stuff (via xhr) depends on the string in that id.
Static route usually looks like this:
router.on('route:some-route', function () {
require(['views/some-view'], function (ViewPage) {
var viewPage = Vm.create(appView, 'viewPage', ViewPage);
viewPage.render();
});
});
For dynamic one you simply need to include the route parameter as an argument:
router.on('route:some-route', function (id) {
......
});
So I need a solution where the route parameter can be passed into the view. What is the most efficient way to do that?