refactor(compiler): initialize RenderComponentType eagerly

This moves the usage of `APP_ID` into the `DomRenderer`.
This commit is contained in:
Tobias Bosch
2016-11-02 08:11:10 -07:00
committed by Vikram Subramanian
parent 5f1dddc5d0
commit 7c5cc9bc41
10 changed files with 63 additions and 79 deletions

View File

@ -147,7 +147,7 @@ class AppModuleInjector extends import0.NgModuleInjector<import1.AppModule> {
if ((this.__DomRootRenderer_19 == (null as any))) {
(this.__DomRootRenderer_19 = new import13.DomRootRenderer_(
this._DOCUMENT_13, this._EventManager_16, this._DomSharedStylesHost_17,
this._AnimationDriver_18));
this._AnimationDriver_18, this._APP_ID_12));
}
return this.__DomRootRenderer_19;
}
@ -172,8 +172,7 @@ class AppModuleInjector extends import0.NgModuleInjector<import1.AppModule> {
}
get _ViewUtils_23(): import15.ViewUtils {
if ((this.__ViewUtils_23 == (null as any))) {
(this.__ViewUtils_23 =
new import15.ViewUtils(this._RootRenderer_20, this._APP_ID_12, this._Sanitizer_22));
(this.__ViewUtils_23 = new import15.ViewUtils(this._RootRenderer_20, this._Sanitizer_22));
}
return this.__ViewUtils_23;
}

View File

@ -56,7 +56,7 @@ function viewFactory_TreeComponent_Host0(
parentElement: any): import1.AppView<any> {
if ((renderType_TreeComponent_Host === (null as any))) {
(renderType_TreeComponent_Host =
viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
import4.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
}
return new _View_TreeComponent_Host0(viewUtils, parentView, parentIndex, parentElement);
}

View File

@ -147,7 +147,7 @@ class AppModuleInjector extends import0.NgModuleInjector<import1.AppModule> {
if ((this.__DomRootRenderer_19 == (null as any))) {
(this.__DomRootRenderer_19 = new import13.DomRootRenderer_(
this._DOCUMENT_13, this._EventManager_16, this._DomSharedStylesHost_17,
this._AnimationDriver_18));
this._AnimationDriver_18, this._APP_ID_12));
}
return this.__DomRootRenderer_19;
}
@ -172,8 +172,7 @@ class AppModuleInjector extends import0.NgModuleInjector<import1.AppModule> {
}
get _ViewUtils_23(): import15.ViewUtils {
if ((this.__ViewUtils_23 == (null as any))) {
(this.__ViewUtils_23 =
new import15.ViewUtils(this._RootRenderer_20, this._APP_ID_12, this._Sanitizer_22));
(this.__ViewUtils_23 = new import15.ViewUtils(this._RootRenderer_20, this._Sanitizer_22));
}
return this.__ViewUtils_23;
}

View File

@ -63,7 +63,7 @@ function viewFactory_TreeRootComponent_Host0(
parentElement: any): import1.AppView<any> {
if ((renderType_TreeRootComponent_Host === (null as any))) {
(renderType_TreeRootComponent_Host =
viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
import4.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
}
return new _View_TreeRootComponent_Host0(viewUtils, parentView, parentIndex, parentElement);
}
@ -125,7 +125,7 @@ export function viewFactory_TreeRootComponent0(
viewUtils: import4.ViewUtils, parentView: import1.AppView<any>, parentIndex: number,
parentElement: any): import1.AppView<import3.TreeRootComponent> {
if ((renderType_TreeRootComponent === (null as any))) {
(renderType_TreeRootComponent = viewUtils.createRenderComponentType(
(renderType_TreeRootComponent = import4.createRenderComponentType(
'/Users/tbosch/projects/conf-demos/ngc-demo/src/ng2_static/root_tree.ts class TreeRootComponent - inline template',
0, import8.ViewEncapsulation.None, styles_TreeRootComponent, {}));
}