search

goog.module

Provided By

Defines a module in Closure.

Marks that this file must be loaded as a module and claims the namespace.

A namespace may only be defined once in a codebase. It may be defined using goog.provide() or goog.module().

goog.module() has three requirements:

  • goog.module may not be used in the same file as goog.provide.
  • goog.module must be the first statement in the file.
  • only one goog.module is allowed per file.

When a goog.module annotated file is loaded, it is enclosed in a strict function closure. This means that:

  • any variables declared in a goog.module file are private to the file (not global), though the compiler is expected to inline the module.
  • The code must obey all the rules of "strict" JavaScript.
  • the file will be marked as "use strict"

NOTE: unlike goog.provide, goog.module does not declare any symbols by itself. If declared symbols are desired, use goog.module.declareLegacyNamespace().

See the public goog.module proposal: http://goo.gl/Va1hin

module( name ) void

Parameters
namestring

Namespace provided by this file in the form "goog.package.part", is expected but not required.

Functions

Properties

Interfaces

Classes