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
1 changed files with 13 additions and 12 deletions

View File

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