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

Function getParentInjectorView

packages/core/src/render3/util/injector_utils.ts:50–62  ·  view source on GitHub ↗
(location: RelativeInjectorLocation, startView: LView)

Source from the content-addressed store, hash-verified

48 * @returns The LView instance that contains the parent injector
49 */
50export function getParentInjectorView(location: RelativeInjectorLocation, startView: LView): LView {
51 let viewOffset = getParentInjectorViewOffset(location);
52 let parentView = startView;
53 // For most cases, the parent injector can be found on the host node (e.g. for component
54 // or container), but we must keep the loop here to support the rarer case of deeply nested
55 // <ng-template> tags or inline views, where the parent injector might live many views
56 // above the child injector.
57 while (viewOffset > 0) {
58 parentView = parentView[DECLARATION_VIEW]!;
59 viewOffset--;
60 }
61 return parentView;
62}

Callers 4

parentInjectorMethod · 0.90
getInjectorParentFunction · 0.90

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…