MCPcopy
hub / github.com/midwayjs/midway / Inject

Function Inject

packages/core/src/decorator/common/inject.ts:112–124  ·  view source on GitHub ↗
(
  identifier?: ObjectIdentifier
)

Source from the content-addressed store, hash-verified

110}
111
112export function Inject(
113 identifier?: ObjectIdentifier
114): PropertyDecorator & ParameterDecorator {
115 return function (target: any, targetKey: string, parameterIndex?: number) {
116 return saveInjectMetadata(
117 identifier,
118 target,
119 targetKey,
120 false,
121 parameterIndex
122 );
123 };
124}
125
126export function LazyInject(
127 identifier?: ObjectIdentifier | (() => ObjectIdentifier | ClassType)

Callers 15

COSServiceFactoryClass · 0.90
COSServiceClass · 0.90
MainConfigurationClass · 0.90
BookConfigurationClass · 0.90
MikroConfigurationClass · 0.90
HelloResolverClass · 0.90
ApolloConfigurationClass · 0.90
HomeControllerClass · 0.90
HomeControllerClass · 0.90

Calls 1

saveInjectMetadataFunction · 0.85

Tested by 5

constructorMethod · 0.72
invokeMethod · 0.72
constructorMethod · 0.72
constructorMethod · 0.72
constructorMethod · 0.72