(type: Type<any>, srcMeta?: Injectable)
| 106 | } |
| 107 | |
| 108 | function 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 | } |
no test coverage detected
searching dependent graphs…