ajile Methods


The following are the various methods provided by ajile:
Back to Documentation



Ajile.AddImportListener: The Ajile.AddImportListener([moduleName,] listener) method is provided to allow developers to add event listeners for import events. Syntax: Ajile.AddImportListener([moduleName,] listener); Parameters: moduleName - An optional parameter that is expected to be a String. When this parameter is specified, it must be the fully-qualified name of a module that was or will be imported. When this parameter is omitted, ajile adds the supplied listener function as a generic listener for all import events. NOTE: When ajile notifies import event listeners, it first notifies specific listeners (listeners for specifically named modules) then the generic (non-module-specific) import event listeners. listener - A required parameter that must be a reference to a function. The function should be defined to accept at least one parameter, a String representing the imported module's fully-qualified name. When this listener function is called by ajile, the imported module's fully-qualifed name is sent as a parameter. Generic import listeners can use the parameter to determine if all of the required module have been successfully imported before attempting to use them. Examples: Ajile.AddImportListener(moduleName, listener); // Notifies listener of import event for specified module. Ajile.AddImportListener(listener); // Notifies listener of all import events. See: - Ajile.RemoveImportListener() Back to Top or Documentation


Ajile.EnableCloak: The Ajile.EnableCloak([cloakState]) method is provided to allow developers to conceal their code at runtime. Cloaking is enabled by default. Syntax: Ajile.EnableCloak([cloakState]); Parameters: cloakState - An optional parameter that when omitted or set to true, instructs ajile to conceal the source code for modules imported or loaded after the option is set. Otherwise when set to false instructs ajile to allow subsequently imported/loaded modules source code to be seen. Examples: Ajile.EnableCloak(); // Enables cloaking. Ajile.EnableCloak(true); // Enables cloaking. Ajile.EnableCloak(false); // Disables cloaking. See: - cloak option Back to Top or Documentation


Ajile.EnableDebug: The Ajile.EnableDebug([debugState]) method is provided to allow developers to observe ajile's debug information. The optional debugState parameter indicates whether to generate or supress debug information. The Debug log contains detailed information about the execution process for operations performed using any of ajile's Directives or Methods. Debugging is disabled by default. Syntax: Ajile.EnableDebug([debugState]); Parameters: debugState - An optional parameter that when omitted or set to true, instructs ajile to generate debug information. Otherwise when set to false instructs ajile to suppress debug information. Examples: Ajile.EnableDebug(); // Enables debug information. Ajile.EnableDebug(true); // Enables debug information. Ajile.EnableDebug(false); // Disables debug information. See: - debug option - Ajile.ShowLog() Back to Top or Documentation


Ajile.EnableLegacy(): The Ajile.EnableLegacy([legacyState]) method is provided to enable/disable support for legacy (deprecated) Directives, Methods, and data types. Legacy support is disabled by default. Syntax: Ajile.EnableLegacy([legacyState]); Parameters: legacyState - An optional parameter that when omitted or set to true, instructs ajile to support deprecated features such as the JSImport, JSLoad, JSPackage, Import, Load, and Package directives and other deprecated methods and data types. When legacyState is set to false ajile is instructed to disallow legacy support and will not process legacy directives, methods, or datatypes. Examples: Ajile.EnableLegacy(); // Enables legacy support. Ajile.EnableLegacy(true); // Enables legacy support. Ajile.EnableLegacy(false); // Disables legacy support. See: - legacy option Back to Top or Documentation


Ajile.EnableOverride: The Ajile.EnableOverride([overrideState]) method is provided to allow similarly named types to override/cancel-out each other. Overriding is disabled by default. Syntax: Ajile.EnableOverride([overrideState]); Parameters: overrideState - An optional parameter that when omitted or set to true, instructs ajile to suppress naming conflicts and allow similarly named types to override each other. Otherwise when set to false instructs ajile to disallow type overrings and generate logged warnings about the naming conflict. Examples: Ajile.EnableOverride(); // Enables overriding. Ajile.EnableOverride(true); // Enables overriding. Ajile.EnableOverride(false); // Disables overriding. See: - override option Back to Top or Documentation


Ajile.EnableRefresh: The Ajile.EnableRefresh([refreshState]) method is provided to support managing the refreshing/caching of loaded scripts and imported modules. Refreshing is disabled by default. Syntax: Ajile.EnableRefresh([refreshState]); Parameters: refreshState - An optional parameter that when omitted or set to true, instructs ajile to generate fresh requests for each subsequently loaded script and imported module. When set to false, ajile will rely on the browser's caching mechanism to determine when to make fresh requests. This option can be used to either work with or circumvent the browser's caching mechanism. Examples: Ajile.EnableRefresh(); // Enables refreshing. Ajile.EnableRefresh(true); // Enables refreshing. Ajile.EnableRefresh(false); // Disables refreshing. See: - refresh option Back to Top or Documentation


Ajile.GetVersion: The Ajile.GetVersion() method is provided to allow developers to retrieve ajile's version information. The method returns a string representing the available version information. Syntax: Ajile.GetVersion(); Returns: A string representing ajile's version information. Examples: var ajileVersion = Ajile.GetVersion(); alert("ajile's version is: "+ ajileVersion); Back to Top or Documentation


Ajile.RemoveImportListener: The Ajile.RemoveImportListener([moduleName,] listener) method is provided to allow developers to remove a previously added import event listener. Syntax: Ajile.RemoveImportListener([moduleName,] listener); Parameters: moduleName - An optional parameter that when specified is expected to be a String value representing the fully-qualified name of a module. This parameter allows multiple listeners to receive import notification for a single module. This parameter can be omitted if it was also omitted when the Ajile.AddImportListener() method was used. listener - A required parameter that must be the same function reference that was supplied to the Ajile.AddImportListener() method. Examples: Ajile.RemoveImportListener(moduleName, listener); // Removes the listener from list of moduleName import observers. Ajile.RemoveImportListener(listener); // Removes the listener from list of generic import observers. See: - Ajile.AddImportListener() Back to Top or Documentation


Ajile.ShowLog: The Ajile.ShowLog() method provides access to ajile's debug log. When debugging is enabled, operation details are continuosly written to the log. Use Ajile.ShowLog() at any time to display a snapshot of the log's output. Syntax: Ajile.ShowLog(); Examples: Ajile.ShowLog(); // Opens a new window/tab displaying ajile's debug log. See: - Ajile.EnableDebug() Back to Top or Documentation


Ajile.Unload: The Ajile.Unload() method is provided to support memory management, allowing containers to unload specific modules, namespaces or ajile and its resources from memory. Calling this method with no parameters will remove ajile's Directives, Methods, and Properties & Dataypes from memory, making all unavailable to the current container. Syntax: Ajile.Unload([moduleName|namespace]); Parameters: moduleName - An optional parameter that can be used to specify the name of a specific module to remove from memory. When omitted ajile will remove itself (com.iskitz.ajile and Ajile) from memory. namespace - An optional parameter that can be used to specify a namespace to remove from memory. When omitted ajile will remove itself (com.iskitz.ajile and Ajile) from memory. Examples: Ajile.Unload(); // Unloads ajile from memory. Ajile.Unload("com.iskitz.ajile.Examples"); // Unloads Examples module from memory. Ajile.Unload("com.iskitz.ajile.examples.*"); // Unloads examples namespace and members from memory. Back to Top or Documentation