Skip to content

Instantly share code, notes, and snippets.

@thadk
Last active December 30, 2015 10:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thadk/7817305 to your computer and use it in GitHub Desktop.
Save thadk/7817305 to your computer and use it in GitHub Desktop.
Backbone Marionette module starting from [this fork]( https://github.com/elycruz/generator-marionette ) and [this repo]( https://github.com/mrichard/generator-marionette ) and [for this comment]( https://github.com/mrichard/generator-marionette/issues/37 ) .
define([
'backbone',
'application',
'apps/my-app-mod/layout/my-app-mod-layout',
'apps/my-app-mod/my-app-mod-list',
'apps/my-app-mod/item/message-view',
'apps/my-app-mod/my-app-mod'
], function(Backbone, app, MyAppModLayout, MyAppModListController, MessageView, AppRouter) {
'use strict';
return app.module('myAppMod', function(mod) {
mod.addInitializer(function() {
var myAppModLayout = new MyAppModLayout();
app.content.show(myAppModLayout);
var myAppModListController = new MyAppModListController({
application: app,
layout: myAppModLayout
});
app.router = new AppRouter({
controller: myAppModListController});
console.log('MyAppMod has been initialized.');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment