Skip to content

Instantly share code, notes, and snippets.

@mattd
Created December 14, 2012 14:29
Show Gist options
  • Select an option

  • Save mattd/4285818 to your computer and use it in GitHub Desktop.

Select an option

Save mattd/4285818 to your computer and use it in GitHub Desktop.
define([
'marionette',
'modules/login',
'modules/main'
], function (Marionette, loginModule, mainModule) {
"use strict";
var app = new Marionette.Application();
app.addRegions({canvas: '#canvas'});
app.module('login', loginModule);
app.module('main', mainModule);
return app;
});
require([
'app',
'backbone',
'marionette'
], function (app, Backbone, Marionette) {
"use strict";
Marionette.Renderer.render = function (template, data) {
return template(data);
};
app.start();
// Wrap in auth dance.
app.module('login').start();
Backbone.history.start();
});
define([
'routers/login',
'controllers/login'
], function (LoginRouter, LoginController) {
"use strict";
return {
startWithParent: false,
define: function () {
this.addInitializer(function () {
new LoginRouter({
controller: new LoginController({
region: this.config.app.canvas
})
});
});
}
};
});
define([
'routers/index',
'controllers/index'
], function (IndexRouter, IndexController) {
"use strict";
return {
startWithParent: false,
define: function () {
this.addInitializer(function () {
new IndexRouter({
controller: new IndexController({
region: this.config.app.canvas
})
});
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment