Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

stages of backbone app startup

View 1.js
1 2 3 4 5 6 7
App = {
init: function(){
// app initialization and startup goes here
}
}
 
App.init();
View 1.js
1 2 3 4 5 6 7 8 9 10
Backbone.Router.extend({
routes: {
"image/:id": "imageById"
},
imageById: function(id){
var image = imageCollection.get(id);
App.showImage(image);
}
});
View 1.js
1 2 3 4 5 6 7 8 9
Backbone.Router.extend({
routes: {
":roomname": "chatroom"
},
chatroom: function(roomname){
ChatApp.enterRoom(roomname);
}
});
View 1.js
1 2 3 4 5 6 7 8 9 10 11 12 13
App = new Backbone.Marionette.Application();
 
App.addInitializer(function(){
// add some app initialization code, here
});
 
App.addInitializer(function(){
// more initialization stuff
// for a different part of the app
});
 
// run all the initializers and start the app
App.start();
View 1.js
1 2 3 4 5 6 7 8
App = new Backbone.Marionette.Application();
 
/* ... initializers go here ... */
 
// contextual startup
App.on("initialize:after", function(){
Backbone.history.start();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.