From 7096e66597402b4e03a39adb5ec0f32a0c7c72ae Mon Sep 17 00:00:00 2001 From: EisenbergEffect Date: Sun, 15 Oct 2017 09:47:23 -0700 Subject: [PATCH] feat(html-behavior): enable processContent via custom attributes --- src/html-behavior.js | 2 ++ src/view-compiler.js | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/html-behavior.js b/src/html-behavior.js index 39fe7440..f986ab8f 100644 --- a/src/html-behavior.js +++ b/src/html-behavior.js @@ -288,6 +288,8 @@ export class HtmlBehaviorResource { } else { instruction.skipContentProcessing = true; } + } else if (!this.processContent(compiler, resources, node, instruction)) { + instruction.skipContentProcessing = true; } return node; diff --git a/src/view-compiler.js b/src/view-compiler.js index b95bbdab..4f4ea444 100644 --- a/src/view-compiler.js +++ b/src/view-compiler.js @@ -422,6 +422,8 @@ export class ViewCompiler { auTargetID = makeIntoInstructionTarget(node); instructions[auTargetID] = TargetInstruction.lifting(parentInjectorId, liftingInstruction); } else { + let skipContentProcessing = false; + if (expressions.length || behaviorInstructions.length) { injectorId = behaviorInstructions.length ? getNextInjectorId() : false; @@ -429,6 +431,7 @@ export class ViewCompiler { instruction = behaviorInstructions[i]; instruction.type.compile(this, resources, node, instruction, parentNode); providers.push(instruction.type.target); + skipContentProcessing = skipContentProcessing || instruction.skipContentProcessing; } for (i = 0, ii = expressions.length; i < ii; ++i) { @@ -449,7 +452,7 @@ export class ViewCompiler { ); } - if (elementInstruction && elementInstruction.skipContentProcessing) { + if (skipContentProcessing) { return node.nextSibling; }