Skip to content

Instantly share code, notes, and snippets.

@thehydroimpulse
Created October 22, 2012 23:23
Show Gist options
  • Select an option

  • Save thehydroimpulse/3935434 to your computer and use it in GitHub Desktop.

Select an option

Save thehydroimpulse/3935434 to your computer and use it in GitHub Desktop.
// Create a new instance of the container!
container = new container;
// Load a "fake" module. (simple class):
container.module('controller.js', "var controller;controller = (function() {function controller() {}controller.prototype.get = function(route) {alert('Method get called.');};return controller;})();return controller;");
// Resolve / Load this module and assigned it to a global 'controller' variable:
window.controller = new (container.resolve('controller.js'))();
// Call one of it's methods 'get':
controller.get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment