Skip to content

Instantly share code, notes, and snippets.

@jakobo
Created December 21, 2011 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakobo/1507203 to your computer and use it in GitHub Desktop.
Save jakobo/1507203 to your computer and use it in GitHub Desktop.
dependency injection
// require two modules
require(["requiredModuleOne", "requiredModuleTwo"],
// run this callback when modules are loaded
function(moduleOne, moduletwo) {
// explicitly declare a dependency is available
provide(newModuleName, resultWhenRequired);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment