Class: Registry

Registry()

The registry of injectable services.

Constructor

new Registry()

Source:

Extends

  • Map

Methods

(protected) makeName(service) → {string}

Makes a camelCase property name for a service class.
Parameters:
Name Type Description
service function The class of the service.
Source:
Returns:
- The name to use for properties holding an instance of this service.
Type
string

register(target, services)

Register dependencies
Parameters:
Name Type Description
target function The injectable class to be registered.
Properties
Name Type Attributes Description
isInjectable boolean <optional>
True if the target has been registered.
services Array.<function()> The injectable classes the target depends on.
Source:

resolve(target) → {Object}

Resolve dependencies
Parameters:
Name Type Description
target function The class of the service to be resolved.
Properties
Name Type Attributes Description
isInjectable boolean <optional>
True if the target has been registered.
Source:
Returns:
- An instance of the target class.
Type
Object