0

I need 2 create 2 Backbone.Marionette applications which are pretty similar but could have differences in their functionality and views. So, I would like them to share some things but still be able to redefine.

Which way would you choose to solve this task?

Nice, if someone might share a link to a GitHub repo with the same problem been solved.

4

2 回答 2

0

Marionette 可让您开箱即用,尽管机制与您可能习惯的有所不同。Marionette 模块通过调用MyApp.module(moduleName). 您可以根据需要多次拨打此电话;任何后续定义都将覆盖之前的定义。有了这些知识,您可以创建一个ModuleDefaults模块定义,然后使用它为每个模块创建基线行为,然后使用特定于模块的覆盖“重新定义”模块。

我在这里提供一个示例: 如何扩展 MarionetteJS 模块以减少代码重复

于 2013-09-26T05:03:42.247 回答
0

Marionette有一个名为的构造Modules,它可能是您想要用来拆分功能以在多个Marionette应用程序之间共享的构造。

于 2013-09-24T21:48:03.267 回答