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

Function getParentEnvInjector

packages/core/src/debug/ai/di_graph.ts:249–262  ·  view source on GitHub ↗

Find the parent environment injector of the given injector.

(injector: Injector)

Source from the content-addressed store, hash-verified

247
248/** Find the parent environment injector of the given injector. */
249function getParentEnvInjector(injector: Injector): Injector | undefined {
250 if (injector instanceof ChainedInjector) {
251 // We skip `chainedInjector.injector` because that points at the parent element injector
252 // which is handled by `walkElementInjectors`.
253 const chainedInjector = injector;
254 return chainedInjector.parentInjector;
255 } else if (injector instanceof R3Injector) {
256 return injector.parent;
257 } else if (injector instanceof NullInjector) {
258 return undefined;
259 } else {
260 throw new Error(`Unknown injector type: "${injector.constructor.name}".`);
261 }
262}

Callers 1

serializeAncestorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…