fix(ivy): use the root view injector when resolving dependencies (#27090)

PR Close #27090
This commit is contained in:
Marc Laval
2018-11-14 17:04:22 +01:00
committed by Andrew Kushnir
parent 8a626288a6
commit 1c9e526a83
7 changed files with 221 additions and 26 deletions

View File

@ -236,9 +236,12 @@ export function getParentInjectorTNode(
}
let viewOffset = getParentInjectorViewOffset(location);
// view offset is 1
let parentView = startView;
let parentTNode = startView[HOST_NODE] as TElementNode;
while (viewOffset > 0) {
// view offset is superior to 1
while (viewOffset > 1) {
parentView = parentView[DECLARATION_VIEW] !;
parentTNode = parentView[HOST_NODE] as TElementNode;
viewOffset--;