AbstractModule

AbstractModule ⇐ Class

Kind: global abstract class
Extends: Class
Mixes: MObjectStates
Properties

NameTypeDescription
configObject

The configuration of the module

exportsArray.<Trait>

A list of trait's exported by the module

typenumber

the type of the module, two modules may have the same type @see ModuleTypes

AbstractModule()

Class defining a Module definition.

load(state) ⇒ Promise

Load the module dynamically

Kind: instance method of AbstractModule

ParamType
statenumber

exportSharedObjects() ⇒ Array.<Object>

Method call by ModuleManager for import shared objects

Kind: instance method of AbstractModule

_initialize() ⇒ Promise

Initialize the module, dispatch event and change state Extension point: initialize

Kind: instance method of AbstractModule
Emits: initialized
Access: protected

_registerRoutes() ⇒ Promise

Register the routes declared in exports array property

Kind: instance method of AbstractModule
Emits: routesRegistered
Access: protected

_beforeShow() ⇒ Promise

Call extension point, dispatch the event and change the state Extension point: beforeShow

Kind: instance method of AbstractModule
Emits: ready
Access: protected

destroy()

Destroy the AbstractModule

Kind: instance method of AbstractModule

initialize()

Extension point that is called right after the AbstractModule has been initialized. You should rarely need to implement it.

Kind: instance method of AbstractModule

registerRoutes()

Extension point

Kind: instance method of AbstractModule

beforeShow()

Extension point that is called when the AbstractModule is ready to be shown. The first screen is not yet shown. Right place to initialize services, player, get data, …

Kind: instance method of AbstractModule

“ready”

Fired when the module is ready

Kind: event emitted by AbstractModule
Properties

NameTypeDescription
dataModule

The instance of the module

“initialized”

Fired when the module have been initialized

Kind: event emitted by AbstractModule
Properties

NameTypeDescription
dataModule

The instance of the module

“routesRegistered”

Fired when all routes of the module are registered.

Kind: event emitted by AbstractModule
Properties

NameTypeDescription
dataModule

The instance of the module

STATE_CREATED : number

Module instance have been created

Kind: static constant of AbstractModule
Default: 0

STATE_INITIALIZED : number

Module have been initialized (@See initialize})

Kind: static constant of AbstractModule
Default: 1

STATE_ROUTES_REGISTERED : number

The routes of the module have been registered (@See registerRoutes})

Kind: static constant of AbstractModule
Default: 2

STATE_READY : number

The module is ready It has been registered and loaded without error

Kind: static constant of AbstractModule
Default: 3

STATE_ERROR : number

There was an error registering or loading the module

Kind: static constant of AbstractModule
Default: 4

getId() ⇒ string

Retrieves the unique identifier for current module.

Kind: static method of AbstractModule
Returns: string - a unique identifier for the module which is the name of the class, with the first letter lowercase