Skip to content

Commit 51e1994

Browse files
vikermanchuckjaz
authored andcommitted
fix(compiler): Do not embed templateUrl in view factories in non-debug mode. (#11818)
Fixes #11117.
1 parent faf5d90 commit 51e1994

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

modules/@angular/compiler/src/view_compiler/view_builder.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -514,18 +514,19 @@ function createViewFactory(
514514
}
515515
if (view.viewIndex === 0) {
516516
var animationsExpr = o.literalMap(view.animations.map(entry => [entry.name, entry.fnExp]));
517-
initRenderCompTypeStmts = [new o.IfStmt(renderCompTypeVar.identical(o.NULL_EXPR), [
518-
renderCompTypeVar
519-
.set(ViewConstructorVars.viewUtils.callMethod(
520-
'createRenderComponentType',
521-
[
522-
o.literal(templateUrlInfo),
523-
o.literal(view.component.template.ngContentSelectors.length),
524-
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation), view.styles,
525-
animationsExpr
526-
]))
527-
.toStmt()
528-
])];
517+
initRenderCompTypeStmts = [new o.IfStmt(
518+
renderCompTypeVar.identical(o.NULL_EXPR),
519+
[renderCompTypeVar
520+
.set(ViewConstructorVars.viewUtils.callMethod(
521+
'createRenderComponentType',
522+
[
523+
view.genConfig.genDebugInfo ? o.literal(templateUrlInfo) : o.literal(''),
524+
o.literal(view.component.template.ngContentSelectors.length),
525+
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation),
526+
view.styles,
527+
animationsExpr,
528+
]))
529+
.toStmt()])];
529530
}
530531
return o
531532
.fn(viewFactoryArgs, initRenderCompTypeStmts.concat([new o.ReturnStatement(

0 commit comments

Comments
 (0)