Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
stages of backbone app startup
App = {
init: function(){
// app initialization and startup goes here
}
}
App.init();
Backbone.Router.extend({
routes: {
"image/:id": "imageById"
},
imageById: function(id){
var image = imageCollection.get(id);
App.showImage(image);
}
});
Backbone.Router.extend({
routes: {
":roomname": "chatroom"
},
chatroom: function(roomname){
ChatApp.enterRoom(roomname);
}
});
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();
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.