AbstractModuleService
On this page
- AbstractModuleService ⇐
Abstract- AbstractModuleService()
- register(moduleName)
- isModuleRegistered(moduleId) ⇒
boolean - load(moduleId) ⇒
*|CancelablePromise - resolveModule(moduleId) ⇒
Promise.<Module> - getModuleById(moduleId) ⇒
Promise.<Module> - getModuleIds() ⇒
Array.<String> - destroy()
- getSharedObject(type) ⇒
Object - getCornersSharedObject(type) ⇒
Object - __initializeCorners([options]) ⇒
Promise.<Array.<Module>> - _getCorners([options]) ⇒
Promise.<Array.<Module>> - _initialize() ⇒
Promise - _registerRoutes() ⇒
Promise - _beforeShow() ⇒
Promise - “loaded”
AbstractModuleService ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Service:
Properties
| Name | Type | Description |
|---|---|---|
| hasCorners | Boolean | Flag that defines whether this module has corners or not |
- AbstractModuleService ⇐
Abstract- new AbstractModuleService()
- .register(moduleName)
- .isModuleRegistered(moduleId) ⇒
boolean - .load(moduleId) ⇒
*|CancelablePromise - .resolveModule(moduleId) ⇒
Promise.<Module> - .getModuleById(moduleId) ⇒
Promise.<Module> - .getModuleIds() ⇒
Array.<String> - .destroy()
- .getSharedObject(type) ⇒
Object - .getCornersSharedObject(type) ⇒
Object - .__initializeCorners([options]) ⇒
Promise.<Array.<Module>> - ._getCorners([options]) ⇒
Promise.<Array.<Module>> - ._initialize() ⇒
Promise - ._registerRoutes() ⇒
Promise - ._beforeShow() ⇒
Promise - “loaded”
AbstractModuleService()
The module service is responsible to discover the modules, register and load them.
register(moduleName)
Register a module.
Kind: instance method of AbstractModuleService
Throws:
- Will throw an error if the module is already registered or if input arg is wrong
| Param | Type | Description |
|---|---|---|
| moduleName | String | The moduleId to register |
isModuleRegistered(moduleId) ⇒ boolean
Return true if the module has been registered
Kind: instance method of AbstractModuleService
Returns: boolean - true if registered
| Param | Type | Description |
|---|---|---|
| moduleId | String | The id of the module |
load(moduleId) ⇒ * | CancelablePromise
Load the module
Kind: instance method of AbstractModuleService
| Param | Type | Description |
|---|---|---|
| moduleId | String | The id of the module |
resolveModule(moduleId) ⇒ Promise.<Module>
Get module instance by id. Create the instance if not yet done (singleton pattern).
Kind: instance method of AbstractModuleService
Returns: Promise.<Module> - The instance of the module
| Param | Type | Description |
|---|---|---|
| moduleId | String | The id of the module, as defined by the @module annotation |
getModuleById(moduleId) ⇒ Promise.<Module>
Get module instance by id. lazy-loading the instance, or provide the one already registered
Kind: instance method of AbstractModuleService
Returns: Promise.<Module> - The instance of the module
Throws:
- Will throw an error if the module is not registered
| Param | Type | Description |
|---|---|---|
| moduleId | String | The id of the module, as defined by the @module annotation |
getModuleIds() ⇒ Array.<String>
Return the list of module ids registered so far
Kind: instance method of AbstractModuleService
Returns: Array.<String> - An array of module ids
destroy()
Destroy the modules
Kind: instance method of AbstractModuleService
getSharedObject(type) ⇒ Object
Get shared objects of a certain type
Kind: instance method of AbstractModuleService
| Param | Type |
|---|---|
| type | String |
getCornersSharedObject(type) ⇒ Object
Get shared objects of a certain type
Kind: instance method of AbstractModuleService
| Param | Type |
|---|---|
| type | String |
__initializeCorners([options]) ⇒ Promise.<Array.<Module>>
Kind: instance abstract method of AbstractModuleService
| Param | Type | Description |
|---|---|---|
| [options] | Object | Some options |
| [options.filter] | function |
_getCorners([options]) ⇒ Promise.<Array.<Module>>
Kind: instance abstract method of AbstractModuleService
| Param | Type | Description |
|---|---|---|
| [options] | Object | Some options |
| [options.filter] | function |
_initialize() ⇒ Promise
Initialize all the modules registered so far.
Kind: instance method of AbstractModuleService
Returns: Promise - A promise resolved if all modules were successfully initialized, rejected otherwise
Emits: AbstractModule#event:initialized
_registerRoutes() ⇒ Promise
Register the routes declared in modules
Kind: instance method of AbstractModuleService
Returns: Promise - A promise resolved if all routes of all modules were successfully registered, rejected otherwise
Emits: AbstractModule#event:routesRegistered
_beforeShow() ⇒ Promise
Call the beforeShow extension points of all modules
Kind: instance method of AbstractModuleService
“loaded”
Fired when a module is loaded
Kind: event emitted by AbstractModuleService
Properties
| Name | Type | Description |
|---|---|---|
| data | Module | The instance of the module |