Hemi JavaScript Framework

Hemi.app.module

Description

Modules are external script instrumented with a basic API to operate within the Hemi framework and be included in the Hemi.registry service. Similar to Application Components, the concept permits a typical external JavaScript format but which operates within its own namespace. The module class also includes basic support for unit testing, so that modules may be quickly written to act as externally loaded unit tests. For example, the Application Component Tests includes several unit tests for vetting the Application Component class.

Class Index

static Hemi.app.module.service

version 3.1.9

Static implementation of the hemi.app.module.serviceImpl class.

Hemi.app.module.serviceImpl

version 3.1.9

The module service provides a convenience for modularizing and managing standard JavaScript as reusable components and tests.

Index

Object Index

Method Index

Objects

Module

A Module encapsulates the imported JavaScript and an API for operating within the framework.

Properties

Methods

ModuleBase

The ModuleBase is the raw definition from which a Module implementation is created.

Properties

Methods

DecorateModuleContent

Decorates a module content. Method is virtual and can be overridden.

Syntax

sDecoration = DecorateModuleContent( sName, sPath, sRaw )

Parameters

Returns

sDecoration as String: A value to be included in the module prior to the module being instantiated.

DecorateModuleHeader

Decorates a module header. Method is virtual and can be overridden.

Syntax

sDecoration = DecorateModuleHeader( sName, sPath, sRaw )

Parameters

Returns

sDecoration as String: A value to be included in the module header prior to the module being instantiated.

LoadModule

Loads a Module definition.

Syntax

oModule = LoadModule( sName, sPath, sDecoration, bPathIsContent, sType )

Parameters

Returns

oModule as Module: A new Module object.

NewModule

Creates a new Module object.

Syntax

oModule = NewModule( sName, oContainer, sPath, oModuleService, bPathIsContent, sType )

Parameters

Returns

oModule as Module: A new Module object.

Register

Registers a Module object.

Syntax

object = Register( sName, vContent )

Parameters

Returns

object as object: Internal module object.

UnloadModule

Unloads the specified module.

Syntax

bRemoved = UnloadModule( sModule )

Parameters

Returns

bRemoved as boolean: Bit indicating whether the module was removed.

UnloadModuleImplementations

Destroys all module implementations for the specified module.

Syntax

bRemoved = UnloadModuleImplementations( sModule )

Parameters

Returns

bRemoved as boolean: Bit indicating whether the module implementations were removed.