new Service()

Description

A convenience class for integrating NexusHoratio.spa.Page with NexusHoratio.base.Service.

When used with addService, subclasses will have the page property set.

The class can also be used directly simply to use Service handlers.

Members


page :NexusHoratio.spa.Page


logger :NexusHoratio.base.Logger


name :string

Details
string

shortName :string

Details
string

Methods


activate()

Description

Called each time service is activated.


deactivate()

Description

Called each time service is deactivated.


on( eventType, func ) → {NexusHoratio.base.Service}

Description

Attach a function to an eventType.

Parameters
Name Type Description
eventType NexusHoratio.base.Dispatcher~EventType

Event type to connect with.

func NexusHoratio.base.Dispatcher~Handler

Single argument function to call.

Returns

This instance, for chaining.

Details

off( eventType, func ) → {NexusHoratio.base.Service}

Description

Remove all instances of a function registered to an eventType.

Parameters
Name Type Description
eventType NexusHoratio.base.Dispatcher~EventType

Event type to disconnect from.

func NexusHoratio.base.Dispatcher~Handler

Function to remove.

Returns

This instance, for chaining.

Details

allowReactivation( allow ) → {NexusHoratio.base.Service}

Parameters
Name Type Description
allow boolean

Whether to allow this service to be activated when already active.

Returns

This instance, for chaining.


setShortName( shortName ) → {NexusHoratio.base.Service}

Parameters
Name Type Description
shortName string

Custom name portion of this instance.

Returns

This instance, for chaining.

Events


activate


activated


deactivate


deactivated