backbone.js - BackboneJS, MarionetteJS - Trying to display layout + regions -


i've got following code

$ ->    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 backbone history url routing       if backbone.history         backbone.history.start()     app = new app   app.start() 

i'm trying follow example on page https://github.com/marionettejs/backbone.marionette/wiki/the-relationship-between-regions-and-layouts

but when run code, don't template "#main_layout_hb" inserted region. what's going on there?

you should create app's region using addregions method:

app.addregions     main_region: "#main_wrap" 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -