diff --git a/src/composition-engine.js b/src/composition-engine.js index eb832270..ddaf5b2b 100644 --- a/src/composition-engine.js +++ b/src/composition-engine.js @@ -31,7 +31,7 @@ interface CompositionContext { */ viewModel?: any; /** - * Data to be passed to the "activate" hook on the view model. + * Data to be passed to the "activate" hook on the view model. */ model?: any; /** diff --git a/src/content-selector.js b/src/content-selector.js index c354b40e..82a3d59f 100644 --- a/src/content-selector.js +++ b/src/content-selector.js @@ -25,7 +25,7 @@ export class _ContentSelector { while (currentChild) { nextSibling = currentChild.nextSibling; - if (currentChild.viewSlot) { + if (currentChild.isContentProjectionSource) { let viewSlotSelectors = contentSelectors.map(x => x.copyForViewSlot()); currentChild.viewSlot._installContentSelectors(viewSlotSelectors); } else { diff --git a/src/instructions.js b/src/instructions.js index b9817843..696eaa73 100644 --- a/src/instructions.js +++ b/src/instructions.js @@ -204,6 +204,7 @@ export class TargetInstruction { instruction.behaviorInstructions = [liftingInstruction]; instruction.viewFactory = liftingInstruction.viewFactory; instruction.providers = [liftingInstruction.type.target]; + instruction.lifting = true; return instruction; } @@ -266,6 +267,7 @@ export class TargetInstruction { this.anchorIsContainer = false; this.elementInstruction = null; + this.lifting = false; this.values = null; } diff --git a/src/view-factory.js b/src/view-factory.js index 2f441ae2..0b7fbaf9 100644 --- a/src/view-factory.js +++ b/src/view-factory.js @@ -40,6 +40,7 @@ function elementContainerGet(key) { if (key === ViewSlot) { if (this.viewSlot === undefined) { this.viewSlot = new ViewSlot(this.element, this.instruction.anchorIsContainer); + this.element.isContentProjectionSource = this.instruction.lifting; this.children.push(this.viewSlot); } diff --git a/src/view-slot.js b/src/view-slot.js index 076ef54a..de23fe29 100644 --- a/src/view-slot.js +++ b/src/view-slot.js @@ -40,6 +40,7 @@ export class ViewSlot { this.isAttached = false; this.contentSelectors = null; anchor.viewSlot = this; + anchor.isContentProjectionSource = false; } /**