Skip to main content

Class: ComponentUtils

@ima/core.ComponentUtils

Constructors

constructor

new ComponentUtils(oc)

Initializes the registry used for managing component utils.

Parameters

NameTypeDescription
ocObjectContainerThe application's dependency injector - the object container.

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:31

Properties

_oc

Private _oc: ObjectContainer

The application's dependency injector - the object container.

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:8


_utilities

Private Optional _utilities: Utils

Map of instantiated utilities

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:18


_utilityClasses

Private _utilityClasses: Object = {}

Map of registered utilities.

Index signature

[key: string]: Dependency<any>

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:12


_utilityReferrers

Private _utilityReferrers: StringParameters = {}

Map of referrers to utilities

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:23

Methods

_createUtilityInstance

_createUtilityInstance(alias, utilityClass): any

Parameters

NameType
aliasstring
utilityClassDependency<any>

Returns

any

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:104


getReferrers

getReferrers(): StringParameters

Returns

StringParameters

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:100


getUtils

getUtils(): Utils

Returns object containing all registered utilities

Returns

Utils

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:80


register

register<T>(name, componentUtilityClass?, referrer?): void

Registers single utility class or multiple classes in alias->class mapping.

Type parameters

Name
T

Parameters

NameType
namestring | { [key: string]: string | Dependency<any>; } | Constructor<T> & WithDependencies | AbstractConstructor<T> & Partial<WithDependencies> | Function & { prototype: T } & Partial<WithDependencies> | [OCInjectable<T>, { optional: boolean }]
componentUtilityClass?Dependency<any>
referrer?string

Returns

void

Defined in

packages/core/src/page/renderer/ComponentUtils.ts:38