我有以下代码
$ ->
class MainLayout extends Marionette.Layout
template: Handlebars.compile $("#main_layout_hb").html()
regions:
header : "#header"
options : "#options"
footer : "#footer"
class MainRegion extends Marionette.Region
el:"#main_wrap"
class App extends Marionette.Application
main_region : new MainRegion
main_layout : new MainLayout
onStart: =>
@main_region.show(@main_layout)
# start the backbone history for URL routing
if Backbone.history
Backbone.history.start()
app = new App
app.start()
我正在尝试遵循此页面上的示例https://github.com/marionettejs/backbone.marionette/wiki/The-relationship-between-regions-and-layouts
但是当我运行代码时,我没有将模板“#main_layout_hb”插入该区域。那里发生了什么事?