Created
November 17, 2010 20:16
-
-
Save canonic-epicure/703996 to your computer and use it in GitHub Desktop.
This file contains 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
/* SomeClass.js */ | |
Class("SomeClass", { | |
use : ["jquery.js", "OtherClass"], | |
after : { | |
initialize : function() { | |
new OtherClass(); | |
} | |
} | |
}); | |
/* OtherClass.js */ | |
Class("OtherClass", { | |
after : { | |
initialize : function() { | |
console.log("I did not set jquery.js as dependency here, but it is still loaded, see %o", jQuery); | |
// this is a problem because it should not be available here!!! | |
} | |
} | |
}); | |
use('SomeClass', function () { | |
var a = new SomeClass() | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment