Namespace: PackageManager

AJL. PackageManager

Methods

<static> getPackage(name) → {Boolean|AJL.Package}

Get package from AJL
Parameters:
Name Type Description
name String Name of package
Source:
Returns:
Package if successful and false if not
Type
Boolean | AJL.Package
Example
AJL.PackageManager.getPackage('My Package Name');

<static> getPackages(names) → {Array}

Get packages from AJL
Parameters:
Name Type Description
names Array Array of Package's names which need get
Source:
Returns:
Type
Array
Example
AJL.PackageManager.getPackages([
         'First Package Name',
         'Second Package Name'
     ]);

<static> loadAll() → {AJL.PackageManager}

Load all packages in AJL
Source:
Returns:
Type
AJL.PackageManager
Example
AJL.PackageManager.loadAll();

<static> loadByName(name) → {boolean|AJL.PackageManager}

Load one package by name
Parameters:
Name Type Description
name string Name of package to load
Source:
Returns:
PackageManager if loaded and false if not
Type
boolean | AJL.PackageManager
Example
AJL.PackageManager.loadByName('Own Package Name');

<static> loadByNames(names) → {AJL.PackageManager}

Load packages by names
Parameters:
Name Type Description
names Array Array of Package's names to load
Source:
Returns:
Type
AJL.PackageManager
Example
AJL.PackageManager.loadByNames([
     'First Package Name',
     'Second Package Name'
]);

<static> setPackage(pack) → {boolean|AJL.PackageManager}

Add package to PackageManager or rewrite exists
Parameters:
Name Type Description
pack AJL.Package Package what need to add
Source:
Returns:
False if not successful and PackageManager if successful
Type
boolean | AJL.PackageManager
Example
AJL.PackageManager.setPackage(
     new AJL.Package('New Package', [
             'foo.js',
             'bar.js',
             'style.css',
         ], {
             async: false,
             lazy: true,
             depend: ['Some other Package Name']
         })
     );

<static> setPackages(packs) → {AJL.PackageManager}

Add Packages to PackageManager or rewrite exists
Parameters:
Name Type Description
packs Array Array of AJL.Package objects
Source:
Returns:
Type
AJL.PackageManager
Example
var FooPackage = new AJL.Package('Foo', ['foo.js', 'foo2.js']);
var BarPackage = new AJL.Package('Bar', ['bar.js', 'bar2.js'], {
     async: false,
     depend: ['Foo']
});
AJL.PackageManager.setPackages([FooPackage, BarPackage]);