diff --git a/src/html-behavior.js b/src/html-behavior.js index 46d983ca..14284e83 100644 --- a/src/html-behavior.js +++ b/src/html-behavior.js @@ -119,7 +119,8 @@ export class HtmlBehaviorResource { viewStrategy = viewStrategy || this.viewStrategy || ViewStrategy.getDefault(target); options = { targetShadowDOM:this.targetShadowDOM, - beforeCompile:target.beforeCompile + beforeCompile:target.beforeCompile, + compileSurrogate:true }; if(!viewStrategy.moduleId){ diff --git a/src/view-compiler.js b/src/view-compiler.js index 4766b0ba..70c3865b 100644 --- a/src/view-compiler.js +++ b/src/view-compiler.js @@ -87,7 +87,7 @@ export class ViewCompiler { content.appendChild(document.createComment('')); var factory = new ViewFactory(content, instructions, resources); - factory.surrogateInstruction = templateOrFragment.content ? this.compileSurrogate(templateOrFragment, resources) : null; + factory.surrogateInstruction = options.compileSurrogate ? this.compileSurrogate(templateOrFragment, resources) : null; if(part){ factory.part = part;