goog.module.ModuleInfo
Provided By | |
---|---|
Extends | |
All Implemented Interfaces |
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.
new ModuleInfo( deps, id )
Parameters |
|
---|
Instance Methods
this.addOnDisposeCallback<T>( callback, opt_scope ) → void
void
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added. If a callback is added to an already disposed Disposable, it will be called immediately.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.dispose() → ?
?
Disposes of the object and its resources.
Overrides | ||
---|---|---|
Specified by | ||
Parameters | None. | |
Returns |
|
this.disposeInternal() → void
void
Performs appropriate cleanup. See description of goog.disposable.IDisposable
for examples. Classes that extend goog.Disposable
should override this
method. Not reentrant. To avoid calling it twice, it must only be called from
the subclass' disposeInternal
method. Everywhere else the public dispose
method must be used. For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); };
Overrides | |
---|---|
Parameters | None. |
this.getDisposed() → boolean
boolean
warning Deprecated | Use |
---|
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getId() → string
string
this.getModule() → (goog.module.BaseModule|null)
(goog.module.BaseModule|null)
Gets the module.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getUris() → Array<goog.html.TrustedResourceUrl>
Array<goog.html.TrustedResourceUrl>
Gets the uris of this module.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isDisposed() → boolean
boolean
Overrides | |||
---|---|---|---|
Specified by | |||
Parameters | None. | ||
Returns |
|
this.isLoaded() → boolean
boolean
Determines whether the module has been loaded.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.onError( cause ) → void
void
Calls the error callbacks for the module.
Parameters |
|
---|
this.onLoad( contextProvider ) → boolean
boolean
this.registerCallback( fn, opt_handler ) → goog.module.ModuleLoadCallback
goog.module.ModuleLoadCallback
Registers a function that should be called after the module is loaded.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.registerDisposable( disposable ) → void
void
Associates a disposable object with this object so that they will be disposed together.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.registerEarlyCallback( fn, opt_handler ) → goog.module.ModuleLoadCallback
goog.module.ModuleLoadCallback
Registers a function that should be called after the module is loaded. These
early callbacks are called after Module#initialize
is called but
before the other callbacks are called.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.registerErrback( fn, opt_handler ) → goog.module.ModuleLoadCallback
goog.module.ModuleLoadCallback
Registers a function that should be called if the module load fails.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.setLoaded() → void
void
Marks the current module as loaded. This is useful for subtractive module loading, where occasionally we need to fallback to normal module loading, and re-fetch the module graph. In this case, we need a way to tell the module manager to mark all modules that are already loaded.
this.setModuleConstructor( constructor ) → void
void
Sets the constructor to use to instantiate the module object after the module code is loaded.
Parameters |
|
---|
this.setTrustedUris( uris ) → void
void
Sets the uris of this module.
Parameters |
|
---|
Instance Properties
this.creationStack → (string|undefined)
(string|undefined)
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.