fix(view): ViewPort light should come from the direct parent
This commit is contained in:
@ -261,6 +261,10 @@ export class ProtoElementInjector {
|
||||
return new ElementInjector(this, parent, host, eventCallbacks);
|
||||
}
|
||||
|
||||
directParent(): ProtoElementInjector {
|
||||
return this.distanceToParent < 2 ? this.parent : null;
|
||||
}
|
||||
|
||||
_createBinding(bindingOrType) {
|
||||
if (bindingOrType instanceof DirectiveBinding) {
|
||||
return bindingOrType;
|
||||
|
6
modules/angular2/src/core/compiler/view.js
vendored
6
modules/angular2/src/core/compiler/view.js
vendored
@ -401,7 +401,7 @@ export class ProtoView {
|
||||
// viewPorts
|
||||
var viewPort = null;
|
||||
if (isPresent(binder.templateDirective)) {
|
||||
var destLightDom = this._parentElementLightDom(protoElementInjector, preBuiltObjects);
|
||||
var destLightDom = this._directParentElementLightDom(protoElementInjector, preBuiltObjects);
|
||||
viewPort = new ViewPort(view, element, binder.nestedProtoView, elementInjector, destLightDom);
|
||||
ListWrapper.push(viewPorts, viewPort);
|
||||
}
|
||||
@ -456,8 +456,8 @@ export class ProtoView {
|
||||
}
|
||||
}
|
||||
|
||||
_parentElementLightDom(protoElementInjector:ProtoElementInjector, preBuiltObjects:List):LightDom {
|
||||
var p = protoElementInjector.parent;
|
||||
_directParentElementLightDom(protoElementInjector:ProtoElementInjector, preBuiltObjects:List):LightDom {
|
||||
var p = protoElementInjector.directParent();
|
||||
return isPresent(p) ? preBuiltObjects[p.index].lightDom : null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user