fix(ivy): ChangeDetectorRef should be injectable on ng-container (#29424)

PR Close #29424
This commit is contained in:
Marc Laval
2019-03-20 18:25:40 +01:00
committed by Matias Niemelä
parent 10734ac607
commit 17b3f11e07
3 changed files with 25 additions and 5 deletions

View File

@ -349,7 +349,9 @@ export function createViewRef(
const componentIndex = hostTNode.directiveStart;
const componentView = getComponentViewByIndex(hostTNode.index, hostView);
return new ViewRef(componentView, context, componentIndex);
} else if (hostTNode.type === TNodeType.Element || hostTNode.type === TNodeType.Container) {
} else if (
hostTNode.type === TNodeType.Element || hostTNode.type === TNodeType.Container ||
hostTNode.type === TNodeType.ElementContainer) {
const hostComponentView = findComponentView(hostView);
return new ViewRef(hostComponentView, hostComponentView[CONTEXT], -1);
}