The goog.module.ModuleInfo Class

goog.module.ModuleInfo
> goog.Disposable

goog.module.ModuleInfo(deps, id)

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.

deps {Array.<string>}
Ids of the modules that must be loaded before this one. The ids must be in dependency order (i.e. if the ith module depends on the jth module, then i > j).
id {string}
The module's ID.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.getDependencies()

Gets the dependencies of this module.

returns {Array.<string>}
The ids of the modules that this module depends on.

.getId()

Gets the ID of this module.

returns {string}
The ID.

.getModule()

Gets the module.

returns {goog.module.BaseModule?}
The module if it has been loaded. Otherwise, null.

.getUris()

Gets the uris of this module.

returns {Array.<string>?}
Uris for this module's code.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.isLoaded()

Determines whether the module has been loaded.

returns {boolean}
Whether the module has been loaded.

.onError(cause)

Calls the error callbacks for the module.

cause {goog.module.ModuleManager.FailureType}
What caused the error.

.onLoad(contextProvider)

Sets this module as loaded.

contextProvider {function() : Object}
A function that provides the module context.
returns {boolean}
Whether any errors occurred while executing the onload callbacks.

.registerCallback(fn, opt_handler)

Registers a function that should be called after the module is loaded.

fn {Function}
A callback function that takes a single argument which is the module context.
opt_handler {Object=}
Optional handler under whose scope to execute the callback.
returns {goog.module.ModuleLoadCallback}
Reference to the callback object.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.registerEarlyCallback(fn, opt_handler)

Registers a function that should be called after the module is loaded. These early callbacks are called after {@link Module#initialize} is called but before the other callbacks are called.

fn {Function}
A callback function that takes a single argument which is the module context.
opt_handler {Object=}
Optional handler under whose scope to execute the callback.
returns {goog.module.ModuleLoadCallback}
Reference to the callback object.

.registerErrback(fn, opt_handler)

Registers a function that should be called if the module load fails.

fn {Function}
A callback function that takes a single argument which is the failure type.
opt_handler {Object=}
Optional handler under whose scope to execute the callback.
returns {goog.module.ModuleLoadCallback}
Reference to the callback object.

.setModuleConstructor(constructor)

Sets the constructor to use to instantiate the module object after the module code is loaded.

constructor {Function}
The constructor of a goog.module.BaseModule subclass.

.setUris(uris)

Sets the uris of this module.

uris {Array.<string>}
Uris for this module's code.