0
在Backbone.Marionette文檔添加標準途徑一些聲明我迷惑不解:與方法路由器
您還可以添加標準路線的AppRouter與路由器上的方法。
(https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.approuter.md)
它怎麼可能看起來像在現實中?
在Backbone.Marionette文檔添加標準途徑一些聲明我迷惑不解:與方法路由器
您還可以添加標準路線的AppRouter與路由器上的方法。
(https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.approuter.md)
它怎麼可能看起來像在現實中?
您可以在AppRouter上添加路由並定義在路由器或控制器中處理它的方法。
MyRouter = Backbone.Marionette.AppRouter.extend({
// "someMethod" must exist at controller.someMethod
appRoutes: {
"some/route": "someMethod"
"yet/anotherRoute": "routerMethod" // app router route
},
/* standard routes can be mixed with appRoutes/Controllers above */
routes : {
"some/otherRoute" : "someOtherMethod"
},
// method on the router
routerMethod: function() {
// ...
},
someOtherMethod : function(){
// do something here.
}
});