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

Function multiViewProvidersFactoryResolver

packages/core/src/render3/di_setup.ts:336–368  ·  view source on GitHub ↗

* Use this with `multi` `viewProviders`. * * This factory knows how to concatenate itself with the existing `multi` `providers`.

(
  this: NodeInjectorFactory,
  _: undefined,
  _flags: InternalInjectFlags | undefined,
  _tData: TData,
  lView: LView,
  tNode: TDirectiveHostNode,
)

Source from the content-addressed store, hash-verified

334 * This factory knows how to concatenate itself with the existing `multi` `providers`.
335 */
336function multiViewProvidersFactoryResolver(
337 this: NodeInjectorFactory,
338 _: undefined,
339 _flags: InternalInjectFlags | undefined,
340 _tData: TData,
341 lView: LView,
342 tNode: TDirectiveHostNode,
343): any[] {
344 const factories = this.multi!;
345 let result: any[];
346 if (this.providerFactory) {
347 const componentCount = this.providerFactory.componentProviders!;
348 const multiProviders = getNodeInjectable(
349 lView,
350 lView[TVIEW],
351 this.providerFactory!.index!,
352 tNode,
353 );
354 // Copy the section of the array which contains `multi` `providers` from the component
355 result = multiProviders.slice(0, componentCount);
356 // Insert the `viewProvider` instances.
357 multiResolve(factories, result);
358 // Copy the section of the array which contains `multi` `providers` from other directives
359 for (let i = componentCount; i < multiProviders.length; i++) {
360 result.push(multiProviders[i]);
361 }
362 } else {
363 result = [];
364 // Insert the `viewProvider` instances.
365 multiResolve(factories, result);
366 }
367 return result;
368}
369
370/**
371 * Maps an array of factories into an array of values.

Callers

nothing calls this directly

Calls 3

getNodeInjectableFunction · 0.90
multiResolveFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…