MCPcopy Create free account
hub / github.com/angular/angular / getOrCreateEnvironmentInjector

Function getOrCreateEnvironmentInjector

packages/core/src/defer/rendering.ts:85–98  ·  view source on GitHub ↗

* Checks whether there is a cached injector associated with a given defer block * declaration and returns if it exists. If there is no cached injector present - * creates a new injector and stores in the cache.

(
  parentInjector: Injector,
  tDetails: TDeferBlockDetails,
  providers: Provider[],
)

Source from the content-addressed store, hash-verified

83 * creates a new injector and stores in the cache.
84 */
85function getOrCreateEnvironmentInjector(
86 parentInjector: Injector,
87 tDetails: TDeferBlockDetails,
88 providers: Provider[],
89) {
90 return parentInjector
91 .get(CachedInjectorService)
92 .getOrCreateInjector(
93 tDetails,
94 parentInjector as EnvironmentInjector,
95 providers,
96 ngDevMode ? 'DeferBlock Injector' : '',
97 );
98}
99
100/** Injector Helpers */
101

Callers 1

createDeferBlockInjectorFunction · 0.85

Calls 2

getOrCreateInjectorMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected