Skip to main content

GetService

@quik/services


@quik/services / GetService

Function: GetService()

GetService<TService, TOwner>(service, scope?): (target, context) => (this, initialValue) => TService

Defined in: services/src/decorators.ts:14

Decorator used to inject a service instance into a class field.

Type Parameters

TService

TService extends QService

TOwner

TOwner = unknown

Parameters

service

string | Constructor<TService>

The service constructor or its registered name.

scope?

QServiceScopeResolver<TOwner>

Optional static or instance-derived service scope.

Returns

(target, context) => (this, initialValue) => TService