Coupling backbone.eventrouter with a marionette.toolkit.app
var RouterApp = Marionette.Toolkit.RouterApp.extend({
eventRoutes:{
'foo:event' : {
action : 'showFoo',
route : 'foo/list'
},
'bar:event': {
action : 'showBar',
route : 'bar/:id'
}
},
childApps: function(){
return {
foo: FooToolkitApp,
bar: BarToolkitApp
};
},
showFoo: function() {
this.startApp('foo');
},
showBar: function(id){
this.startApp('bar', { id : id });
}
});