The goog.module Namespace

The goog.module.AbstractModuleLoader Interface

An interface that loads JavaScript modules. @interface … more

The goog.module.BaseModule Class

A basic module object that represents a module of Javascript code that can be dynamically loaded. … more

The goog.module.Loader Class

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. … more

The goog.module.ModuleInfo Class

A ModuleInfo object is used by the ModuleManager to hold information about a module of js code that may or may not yet be loaded into the environment. … more

The goog.module.ModuleLoadCallback Class

Class used to encapsulate the callbacks to be called when a module loads. … more

The goog.module.ModuleLoader Class

A class that loads Javascript modules. … more

The goog.module.ModuleManager Class

The ModuleManager keeps track of all modules in the environment. Since modules may not have their code loaded, we must keep track of them. … more

.initLoader(urlBase, opt_urlFunction)

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.

urlBase {string}
The URL of the base library.
opt_urlFunction {Function=}
Function that creates the URL for the module file. It will be passed the base URL for module files and the module name and should return the fully-formed URL to the module file to load.

.loaderCall(module, symbol)

Produces a function that delegates all its arguments to a dynamically loaded function. This is used to export dynamically loaded functions.

module {string}
The module to load from.
symbol {number|string}
The ID of the symbol to load from the module. This symbol must resolve to a function.
returns {!Function}
A function that forwards all its arguments to the dynamically loaded function specified by module and symbol.

.provide(module, opt_symbol, opt_object)

Wrapper of goog.module.Loader.provide() for use in modules See method goog.module.Loader.provide() for explanation of params.

module {string}
The name of the module. Cf. parameter module of method require().
opt_symbol {number|string=}
The symbol being defined, or nothing when all symbols of the module are defined. Cf. parameter symbol of method require().
opt_object {Object=}
The object bound to the symbol, or nothing when all symbols of the module are defined.

.require(module, symbol, callback)

Wrapper of goog.module.Loader.require() for use in modules. See method goog.module.Loader.require() for explanation of params.

module {string}
The name of the module. Usually, the value is defined as a constant whose name starts with MOD_.
symbol {number|string}
The ID of the symbol. Usually, the value is defined as a constant whose name starts with SYM_.
callback {Function}
This function will be called with the resolved symbol as the argument once the module is loaded.

.requireMultipleSymbols(symbolRequests, finalCb)

Requires symbols for multiple modules, and invokes a final callback on the condition that all of them are loaded. I.e. a barrier for loading of multiple symbols. If no symbols are required, the final callback is called immediately.

symbolRequests {Array.<Object>}
A list of tuples of module, symbol, callback (analog to the arguments to require(), above). These will each be require()d individually. NOTE: This argument will be modified during execution of the function.
finalCb {Function}
A function that is called when all required symbols are loaded.

The goog.module.testdata Namespace

… more