MCPcopy Index your code
hub / github.com/angular/angular / getInjectableMetadata

Function getInjectableMetadata

packages/core/src/di/jit/injectable.ts:108–131  ·  view source on GitHub ↗
(type: Type<any>, srcMeta?: Injectable)

Source from the content-addressed store, hash-verified

106}
107
108function getInjectableMetadata(type: Type<any>, srcMeta?: Injectable): R3InjectableMetadataFacade {
109 // Allow the compilation of a class with a `@Injectable()` decorator without parameters
110 const meta: Injectable = srcMeta || {providedIn: null};
111 const compilerMeta: R3InjectableMetadataFacade = {
112 name: type.name,
113 type: type,
114 typeArgumentCount: 0,
115 providedIn: meta.providedIn,
116 };
117 if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {
118 compilerMeta.deps = convertDependencies(meta.deps);
119 }
120 // Check to see if the user explicitly provided a `useXxxx` property.
121 if (isUseClassProvider(meta)) {
122 compilerMeta.useClass = meta.useClass;
123 } else if (isUseValueProvider(meta)) {
124 compilerMeta.useValue = meta.useValue;
125 } else if (isUseFactoryProvider(meta)) {
126 compilerMeta.useFactory = meta.useFactory;
127 } else if (isUseExistingProvider(meta)) {
128 compilerMeta.useExisting = meta.useExisting;
129 }
130 return compilerMeta;
131}

Callers 1

compileInjectableFunction · 0.85

Calls 5

convertDependenciesFunction · 0.90
isUseClassProviderFunction · 0.85
isUseFactoryProviderFunction · 0.85
isUseValueProviderFunction · 0.85
isUseExistingProviderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…