fix(compiler): make code easier to type check

These changes are needed for the G3 sync as we use a different version/settings of Typescript than on Github.

closes #9701
This commit is contained in:
Tobias Bosch
2016-06-29 10:26:45 -07:00
parent e81dea695c
commit 51d4c9dcbd
3 changed files with 15 additions and 10 deletions

View File

@ -172,13 +172,15 @@ export class RuntimeCompiler implements ComponentResolver, Compiler {
var depTemplates = compileResult.dependencies.map((dep) => {
let depTemplate: CompiledTemplate;
if (dep instanceof ViewFactoryDependency) {
depTemplate = this._getCompiledTemplate(dep.comp.runtime);
dep.placeholder.runtime = depTemplate.proxyViewFactory;
dep.placeholder.name = `viewFactory_${dep.comp.name}`;
let vfd = <ViewFactoryDependency>dep;
depTemplate = this._getCompiledTemplate(vfd.comp.runtime);
vfd.placeholder.runtime = depTemplate.proxyViewFactory;
vfd.placeholder.name = `viewFactory_${vfd.comp.name}`;
} else if (dep instanceof ComponentFactoryDependency) {
depTemplate = this._getCompiledHostTemplate(dep.comp.runtime);
dep.placeholder.runtime = depTemplate.proxyComponentFactory;
dep.placeholder.name = `compFactory_${dep.comp.name}`;
let cfd = <ComponentFactoryDependency>dep;
depTemplate = this._getCompiledHostTemplate(cfd.comp.runtime);
cfd.placeholder.runtime = depTemplate.proxyComponentFactory;
cfd.placeholder.name = `compFactory_${cfd.comp.name}`;
}
return depTemplate;
});