Skip to content

Instantly share code, notes, and snippets.

@cjbell
Last active December 11, 2015 12:59
Show Gist options
  • Save cjbell/4604828 to your computer and use it in GitHub Desktop.
Save cjbell/4604828 to your computer and use it in GitHub Desktop.
BigBird Initialiser example #1
<body data-module="blogs" data-action="index"></body>
window.Modules = {} || Modules;
Modules.Blogs = {
initialize: function() {
// This gets called everytime the module is equal to blogs
new Component();
},
index: function() {
// This *only* gets called when the module is blogs and the action is index
new OtherComponent();
}
};
Modules.Common = {
initialize: function() {
// This gets called on *every* module.
new CommonComponent();
}
}
new BigBird.Initializer({ modules: Modules });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment