(location: RelativeInjectorLocation, startView: LView)
| 48 | * @returns The LView instance that contains the parent injector |
| 49 | */ |
| 50 | export 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 | } |
no test coverage detected
searching dependent graphs…