Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created January 25, 2012 15:41
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 bennadel/1676841 to your computer and use it in GitHub Desktop.
Save bennadel/1676841 to your computer and use it in GitHub Desktop.
Managed Dependencies vs. Dependency Injection In RequireJS
// Define our class within the dependency management system.
define(
[
"dependency-1",
"dependency-2"
],
function( Dependency1, Dependency2 ){
// Define the actual class constructor and methods.
function MyClass( argument1, argument2 ){
// ... more code ...
}
// -------------------------------------------------- //
// -------------------------------------------------- //
// Return the class constructor to define the class
// representation within the dependency management system.
return( MyClass );
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment