fix(OfflineCompiler): support older TS versions (#11734)

This commit is contained in:
Victor Berchet 2016-09-19 15:36:25 -07:00 committed by Alex Eagle
parent 03aedbe54b
commit 70488ed382
1 changed files with 5 additions and 3 deletions

View File

@ -192,10 +192,12 @@ export class OfflineCompiler {
function _resolveViewStatements(compileResult: ViewCompileResult): o.Statement[] { function _resolveViewStatements(compileResult: ViewCompileResult): o.Statement[] {
compileResult.dependencies.forEach((dep) => { compileResult.dependencies.forEach((dep) => {
if (dep instanceof ViewFactoryDependency) { if (dep instanceof ViewFactoryDependency) {
dep.placeholder.moduleUrl = _ngfactoryModuleUrl(dep.comp.moduleUrl); const vfd = <ViewFactoryDependency>dep;
vfd.placeholder.moduleUrl = _ngfactoryModuleUrl(vfd.comp.moduleUrl);
} else if (dep instanceof ComponentFactoryDependency) { } else if (dep instanceof ComponentFactoryDependency) {
dep.placeholder.name = _componentFactoryName(dep.comp); const cfd = <ComponentFactoryDependency>dep;
dep.placeholder.moduleUrl = _ngfactoryModuleUrl(dep.comp.moduleUrl); cfd.placeholder.name = _componentFactoryName(cfd.comp);
cfd.placeholder.moduleUrl = _ngfactoryModuleUrl(cfd.comp.moduleUrl);
} }
}); });
return compileResult.statements; return compileResult.statements;