Skip to content

Commit

Permalink
feat(html-behavior): enable processContent via custom attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Oct 15, 2017
1 parent c08db20 commit 7096e66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/html-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ export class HtmlBehaviorResource {
} else {
instruction.skipContentProcessing = true;
}
} else if (!this.processContent(compiler, resources, node, instruction)) {
instruction.skipContentProcessing = true;
}

return node;
Expand Down
5 changes: 4 additions & 1 deletion src/view-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,16 @@ 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;

for (i = 0, ii = behaviorInstructions.length; i < ii; ++i) {
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) {
Expand All @@ -449,7 +452,7 @@ export class ViewCompiler {
);
}

if (elementInstruction && elementInstruction.skipContentProcessing) {
if (skipContentProcessing) {
return node.nextSibling;
}

Expand Down

0 comments on commit 7096e66

Please sign in to comment.