goog.module.Loader
Classgoog.module.Loader()
The dynamic loading functionality is defined as a class. The class will be used as singleton. There is, however, a two step initialization procedure because parameters need to be passed to the goog.module.Loader instance.
.LOAD_CALLBACK
{string
}The globally exported name of the load callback. Matches the definition in the js_modular_binary() BUILD rule.
.init(baseUrl, opt_urlFunction)
Initializes the Loader to be fully functional. Also executes load requests that were received before initialization. Must be called exactly once, with the URL of the base library. Module URLs are derived from the URL of the base library by inserting the module name, preceded by a period, before the .js prefix of the base URL.
baseUrl
{string
}
opt_urlFunction
{Function
=}
.provide(module, opt_symbol, opt_object)
Registers a symbol in a loaded module. When called without symbol, registers the module to be fully loaded and executes all callbacks from pending require() callbacks for this module.
module
{string
}
opt_symbol
{number
|string
=}
opt_object
{Object
=}
.require(module, symbol, callback)
Requests the loading of a symbol from a module. When the module is loaded, the requested symbol will be passed as argument to the function callback.
module
{string
}
symbol
{number
|string
}
callback
{Function
}