refactor(compiler): inline view.viewChildren in generated code

This commit is contained in:
Tobias Bosch
2016-10-31 10:10:13 -07:00
committed by vsavkin
parent 97471d74b6
commit e5fdf4c70a
5 changed files with 36 additions and 32 deletions

View File

@ -38,7 +38,7 @@ class _View_TreeComponent_Host0 extends import1.AppView<any> {
this._vc_0 = new import2.AppElement(0, (null as any), this, this._el_0);
this._TreeComponent_0_4 = new _View_TreeComponent0(this._el_0);
this._vc_0.initComponent(this._TreeComponent_0_4.context, [], <any>this._TreeComponent_0_4);
this.init([].concat([this._el_0]), [this._el_0], [], []);
this.init([].concat([this._el_0]), [this._el_0], []);
return this._vc_0;
}
detectChangesInternal(throwOnChange: boolean): void {

View File

@ -27,6 +27,7 @@ class _View_TreeRootComponent_Host0 extends import1.AppView<any> {
_el_0: any;
/*private*/ _appEl_0: import2.AppElement;
_TreeRootComponent_0_4: import3.TreeRootComponent;
_TreeRootComponent_0_4_View: any;
constructor(
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
declarationEl: import2.AppElement) {
@ -38,14 +39,19 @@ class _View_TreeRootComponent_Host0 extends import1.AppView<any> {
this._el_0 = import4.selectOrCreateRenderHostElement(
this.renderer, 'tree', import4.EMPTY_INLINE_ARRAY, rootSelector, (null as any));
this._appEl_0 = new import2.AppElement(0, (null as any), this, this._el_0);
var compView_0: any =
this._TreeRootComponent_0_4_View =
viewFactory_TreeRootComponent0(this.viewUtils, this.injector(0), this._appEl_0);
this._TreeRootComponent_0_4 = new import3.TreeRootComponent();
this._appEl_0.initComponent(this._TreeRootComponent_0_4, [], compView_0);
compView_0.create(this._TreeRootComponent_0_4, this.projectableNodes, (null as any));
this.init([].concat([this._el_0]), [this._el_0], [], []);
this._appEl_0.initComponent(this._TreeRootComponent_0_4, [], this._TreeRootComponent_0_4_View);
this._TreeRootComponent_0_4_View.create(
this._TreeRootComponent_0_4, this.projectableNodes, (null as any));
this.init([].concat([this._el_0]), [this._el_0], []);
return this._appEl_0;
}
detectChangesInternal(throwOnChange: boolean): void {
this._TreeRootComponent_0_4_View.detectChangesInternal(throwOnChange);
}
destroyInternal(): void { this._TreeRootComponent_0_4_View.destroyInternal(); }
injectorGetInternal(token: any, requestNodeIndex: number, notFoundResult: any): any {
if (((token === import3.TreeRootComponent) && (0 === requestNodeIndex))) {
return this._TreeRootComponent_0_4;
@ -89,7 +95,7 @@ class _View_TreeRootComponent0 extends import1.AppView<import3.TreeRootComponent
new import11.TemplateRef_(this._appEl_0, viewFactory_TreeRootComponent1);
this._NgIf_0_6 = new import10.NgIf(this._appEl_0.vcRef, this._TemplateRef_0_5);
this._expr_0 = import7.UNINITIALIZED;
this.init([], [this._anchor_0], [], []);
this.init([], [this._anchor_0], []);
return (null as any);
}
injectorGetInternal(token: any, requestNodeIndex: number, notFoundResult: any): any {
@ -108,7 +114,6 @@ class _View_TreeRootComponent0 extends import1.AppView<import3.TreeRootComponent
this._expr_0 = currVal_0;
}
this.detectContentChildrenChanges(throwOnChange);
this.detectViewChildrenChanges(throwOnChange);
}
}
export function viewFactory_TreeRootComponent0(
@ -134,7 +139,7 @@ class _View_TreeRootComponent1 extends import1.AppView<any> {
createInternal(rootSelector: string): import2.AppElement {
this._el_0 = this.renderer.createElement((null as any), 'tree0', (null as any));
this._TreeComponent0_0_4View = new import13.View_TreeTreeComponent(maxDepth - 1, this._el_0);
this.init([].concat([this._el_0]), [this._el_0], [], []);
this.init([].concat([this._el_0]), [this._el_0], []);
return (null as any);
}
destroyInternal() { this._TreeComponent0_0_4View.destroyInternal(); }