(
providers: Array<Provider | EnvironmentProviders>,
readonly parent: Injector,
readonly source: string | null,
readonly scopes: Set<InjectorScope>,
)
| 214 | private injectorDefTypes: Set<Type<unknown>>; |
| 215 | |
| 216 | constructor( |
| 217 | providers: Array<Provider | EnvironmentProviders>, |
| 218 | readonly parent: Injector, |
| 219 | readonly source: string | null, |
| 220 | readonly scopes: Set<InjectorScope>, |
| 221 | ) { |
| 222 | super(); |
| 223 | // Start off by creating Records for every provider. |
| 224 | forEachSingleProvider(providers as Array<Provider | InternalEnvironmentProviders>, (provider) => |
| 225 | this.processProvider(provider), |
| 226 | ); |
| 227 | |
| 228 | // Make sure the INJECTOR token provides this injector. |
| 229 | this.records.set(INJECTOR, makeRecord(undefined, this)); |
| 230 | |
| 231 | // And `EnvironmentInjector` if the current injector is supposed to be env-scoped. |
| 232 | if (scopes.has('environment')) { |
| 233 | this.records.set(EnvironmentInjector, makeRecord(undefined, this)); |
| 234 | } |
| 235 | |
| 236 | // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide |
| 237 | // any injectable scoped to APP_ROOT_SCOPE. |
| 238 | const record = this.records.get(INJECTOR_SCOPE) as Record<InjectorScope | null>; |
| 239 | if (record != null && typeof record.value === 'string') { |
| 240 | this.scopes.add(record.value as InjectorScope); |
| 241 | } |
| 242 | |
| 243 | this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, {self: true})); |
| 244 | } |
| 245 | |
| 246 | retrieve<T>(token: PrimitivesInjectionToken<T>, options?: unknown): T | NotFound { |
| 247 | const flags: InternalInjectFlags = |
nothing calls this directly
no test coverage detected