window.define Class
define a new module so that you don't care how to create an instance of module. and the method was exposed to global scope
Constructor
window.define
(
Module
static
-
id
-
[req]
-
factory
Parameters:
-
id
Stringthe module name for the instance, it should be unique and the namspace is expected like 'mywork/module1'
-
[req]
Array optionalthe required modules for this module
-
factory
Functionthe factory function for the module
Returns:
Module:
an instance of Module