Namespace: Namespace

AJL. Namespace

Source:

Methods

<static> isNamespaceExists(namespace) → {boolean}

Check if this namespace already exists
Parameters:
Name Type Description
namespace String Namespace divided by "." what need to check
Source:
Returns:
True if exists and false if not
Type
boolean
Example
AJL.Namespace.isNamespaceExists('MyScope.MyModule.SubModule.MyClass');

<static> setNamespace(namespace, module) → {*}

Set namespace for module
Parameters:
Name Type Description
namespace String Namespace of module divided by "."
module * Your module which you want load to namespace
Source:
Returns:
Returns modified window to global scope with your module
Type
*
Example
AJL.Namespace.setNamespace('MyScope.MyModule.SubModule.MyClass', function MyClass(foo, bar) {
     this.foo = foo;
     this.bar = bar;
     return this;
});

<static> waitNamespaceForAvailable(namespace, callback)

Wait for loading namespace into global scope
Parameters:
Name Type Description
namespace String Which namespace we need to wait
callback function Function which call when namespace is loaded
Source:
Example
AJL.Namespace.waitNamespaceForAvailable('MyScope.MyModule.SubModule.MyClass', function() {
     console.log("Yes, I just loaded now");
});