goog.module.Loader
Provided By |
---|
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.
new Loader()
Parameters | None. |
---|
Instance Methods
this.init( baseUrl, opt_urlFunction ) → void
void
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.
Parameters |
|
---|
this.provide( module, opt_symbol, opt_object ) → void
void
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.
Parameters |
|
---|
this.require( module, symbol, callback ) → void
void
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.
Parameters |
|
---|
Static Functions
Loader.getInstance() → goog.module.Loader
goog.module.Loader
Parameters | None. | |
---|---|---|
Returns |
|
Loader.init( urlBase, opt_urlFunction ) → void
void
Wrapper of init() so that we only need to export this single identifier instead of three. See method goog.module.Loader.init() for explanation of param.
Parameters |
|
---|
Loader.loaderCall( module, symbol ) → Function
Function
Produces a function that delegates all its arguments to a dynamically loaded function. This is used to export dynamically loaded functions.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Loader.provide( module, opt_symbol, opt_object ) → void
void
Wrapper of goog.module.Loader.provide() for use in modules See method goog.module.Loader.provide() for explanation of params.
Parameters |
|
---|
Loader.require( module, symbol, callback ) → void
void
Wrapper of goog.module.Loader.require() for use in modules. See method goog.module.Loader.require() for explanation of params.
Parameters |
|
---|
Static Properties
Loader.LOAD_CALLBACK → string
string
The globally exported name of the load callback. Matches the definition in the js_module_binary() BUILD rule.