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

Function getParentInjectorIndex

packages/core/src/render3/util/injector_utils.ts:22–35  ·  view source on GitHub ↗
(parentLocation: RelativeInjectorLocation)

Source from the content-addressed store, hash-verified

20}
21
22export function getParentInjectorIndex(parentLocation: RelativeInjectorLocation): number {
23 if (ngDevMode) {
24 assertNumber(parentLocation, 'Number expected');
25 assertNotEqual(parentLocation as any, -1, 'Not a valid state.');
26 const parentInjectorIndex = parentLocation & RelativeInjectorLocationFlags.InjectorIndexMask;
27
28 assertGreaterThan(
29 parentInjectorIndex,
30 HEADER_OFFSET,
31 'Parent injector must be pointing past HEADER_OFFSET.',
32 );
33 }
34 return parentLocation & RelativeInjectorLocationFlags.InjectorIndexMask;
35}
36
37export function getParentInjectorViewOffset(parentLocation: RelativeInjectorLocation): number {
38 return parentLocation >> RelativeInjectorLocationFlags.ViewOffsetShift;

Callers 4

parentInjectorMethod · 0.90
getInjectorParentFunction · 0.90

Calls 3

assertNumberFunction · 0.90
assertNotEqualFunction · 0.90
assertGreaterThanFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…