Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
dependency injection
var foo = require("foo"),
bar = foo.bar;
exports.bar = bar;
define(function(require, exports, module) {
// your file contents here
});
require.setCrossDomain("http://example.com/relay.html",
"http://cdn.example.com/relay.html");
// 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
Something went wrong with that request. Please try again.