Created
October 22, 2012 23:23
-
-
Save thehydroimpulse/3935434 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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