fix(compiler): Do not embed templateUrl in view factories in non-debug mode. (#11818)

Fixes #11117.
This commit is contained in:
vikerman 2016-09-27 17:09:44 -07:00 committed by Rado Kirov
parent 425c1e6042
commit 3a5b4882bc

View File

@ -514,18 +514,19 @@ function createViewFactory(
} }
if (view.viewIndex === 0) { if (view.viewIndex === 0) {
var animationsExpr = o.literalMap(view.animations.map(entry => [entry.name, entry.fnExp])); var animationsExpr = o.literalMap(view.animations.map(entry => [entry.name, entry.fnExp]));
initRenderCompTypeStmts = [new o.IfStmt(renderCompTypeVar.identical(o.NULL_EXPR), [ initRenderCompTypeStmts = [new o.IfStmt(
renderCompTypeVar renderCompTypeVar.identical(o.NULL_EXPR),
.set(ViewConstructorVars.viewUtils.callMethod( [renderCompTypeVar
'createRenderComponentType', .set(ViewConstructorVars.viewUtils.callMethod(
[ 'createRenderComponentType',
o.literal(templateUrlInfo), [
o.literal(view.component.template.ngContentSelectors.length), view.genConfig.genDebugInfo ? o.literal(templateUrlInfo) : o.literal(''),
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation), view.styles, o.literal(view.component.template.ngContentSelectors.length),
animationsExpr ViewEncapsulationEnum.fromValue(view.component.template.encapsulation),
])) view.styles,
.toStmt() animationsExpr,
])]; ]))
.toStmt()])];
} }
return o return o
.fn(viewFactoryArgs, initRenderCompTypeStmts.concat([new o.ReturnStatement( .fn(viewFactoryArgs, initRenderCompTypeStmts.concat([new o.ReturnStatement(