File

core/common/service-registry.service.ts

Description

Service for managing and retrieving dynamically registered services within the application. It leverages a map of InjectionTokens to associate services with unique extension keys.

Index

Properties
Methods

Constructor

constructor(rootInjector: Injector, pluginService: PluginsResolveService)
Parameters :
Name Type Optional
rootInjector Injector No
pluginService PluginsResolveService No

Methods

get
get(key: T)
Type parameters :
  • T
  • R

Retrieves instances of services registered under a specified extension key.

Example :
```typescript
// Retrieving instances of Service example
const layersServices = serviceRegistry.get('layersServiceKey');
layersServices.forEach(service => service.get().then(layer => console.log(layer)));
Example :
Parameters :
Name Type Optional Description
key T No
  • The extension key associated with the desired service.
Returns : R[]

An array of service instances registered under the given key.

getRegisteredExtensionKeys
getRegisteredExtensionKeys()

Allows to retrieve all registered extension keys.

An array of extension keys that have been registered.

Properties

Protected injectors
Type : Injector[]

results matching ""

    No results matching ""