O'Reilly logo

Getting Started with Backbone Marionette by Arturo Soto, Raymundo Armendariz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining our application module

Now that the core dependencies are configured using Require.js, and once those are loaded and ready, we can define our Marionette application and set up the region initializers, commands, and request/response handlers. This is because we need the inside of a single file that we will name app.js with the idea of keeping all the login details related to the Marionette application object inside of this file. In the following code, our application is defined and ready to work as an AMD module. The following is the content of our app.js file:

define(['marionette'], function(Marionette){ var Books = new Marionette.Application(); Books.addRegions({ main: '#main', modal: ModalRegion }); Books.on('initialize:after', function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required