refactor(compiler): remove view factories, use view classes directly

This commit is contained in:
Tobias Bosch
2016-11-02 08:36:23 -07:00
committed by Vikram Subramanian
parent 7c5cc9bc41
commit 0e3d655220
12 changed files with 64 additions and 112 deletions

View File

@ -20,7 +20,8 @@ import * as import12 from '@angular/core/src/security';
import * as import3 from './tree';
import {_View_TreeComponent0} from './tree.ngfactory';
var renderType_TreeComponent_Host: import0.RenderComponentType = (null as any);
var renderType_TreeComponent_Host: import0.RenderComponentType =
import4.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {});
class _View_TreeComponent_Host0 extends import1.AppView<any> {
_el_0: any;
_vc_0: import2.ViewContainer;
@ -51,15 +52,6 @@ class _View_TreeComponent_Host0 extends import1.AppView<any> {
return notFoundResult;
}
}
function viewFactory_TreeComponent_Host0(
viewUtils: import4.ViewUtils, parentView: import1.AppView<any>, parentIndex: number,
parentElement: any): import1.AppView<any> {
if ((renderType_TreeComponent_Host === (null as any))) {
(renderType_TreeComponent_Host =
import4.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
}
return new _View_TreeComponent_Host0(viewUtils, parentView, parentIndex, parentElement);
}
export const TreeComponentNgFactory: import9.ComponentFactory<import3.TreeComponent> =
new import9.ComponentFactory<import3.TreeComponent>(
'tree', viewFactory_TreeComponent_Host0, import3.TreeComponent);
'tree', _View_TreeComponent_Host0, import3.TreeComponent);

View File

@ -22,7 +22,8 @@ import * as import3 from './tree';
import * as import12 from './tree';
import * as import13 from './tree_branch.ngfactory';
var renderType_TreeRootComponent_Host: import0.RenderComponentType = (null as any);
var renderType_TreeRootComponent_Host: import0.RenderComponentType =
import4.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {});
class _View_TreeRootComponent_Host0 extends import1.AppView<any> {
_el_0: any;
/*private*/ _appEl_0: import2.ViewContainer;
@ -41,7 +42,7 @@ class _View_TreeRootComponent_Host0 extends import1.AppView<any> {
this.renderer, 'tree', import4.EMPTY_INLINE_ARRAY, rootSelector, (null as any));
this._appEl_0 = new import2.ViewContainer(0, (null as any), this, this._el_0);
this._TreeRootComponent_0_4_View =
viewFactory_TreeRootComponent0(this.viewUtils, this, 0, this._el_0);
new _View_TreeRootComponent0(this.viewUtils, this, 0, this._el_0);
this._TreeRootComponent_0_4 = new import3.TreeRootComponent();
this._TreeRootComponent_0_4_View.create(this._TreeRootComponent_0_4, (null as any));
this.init([].concat([this._el_0]), [this._el_0], []);
@ -58,20 +59,13 @@ class _View_TreeRootComponent_Host0 extends import1.AppView<any> {
return notFoundResult;
}
}
function viewFactory_TreeRootComponent_Host0(
viewUtils: import4.ViewUtils, parentView: import1.AppView<any>, parentIndex: number,
parentElement: any): import1.AppView<any> {
if ((renderType_TreeRootComponent_Host === (null as any))) {
(renderType_TreeRootComponent_Host =
import4.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
}
return new _View_TreeRootComponent_Host0(viewUtils, parentView, parentIndex, parentElement);
}
export const TreeRootComponentNgFactory: import9.ComponentFactory<import3.TreeRootComponent> =
new import9.ComponentFactory<import3.TreeRootComponent>(
'tree', viewFactory_TreeRootComponent_Host0, import3.TreeRootComponent);
'tree', _View_TreeRootComponent_Host0, import3.TreeRootComponent);
const styles_TreeRootComponent: any[] = [];
var renderType_TreeRootComponent: import0.RenderComponentType = (null as any);
var renderType_TreeRootComponent: import0.RenderComponentType = 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, {});
class _View_TreeRootComponent0 extends import1.AppView<import3.TreeRootComponent> {
_anchor_0: any;
/*private*/ _appEl_0: import2.ViewContainer;
@ -99,7 +93,7 @@ class _View_TreeRootComponent0 extends import1.AppView<import3.TreeRootComponent
createEmbeddedViewInternal(nodeIndex: number): import1.AppView<any> {
if (nodeIndex === 0) {
return viewFactory_TreeRootComponent1(this.viewUtils, this, 0, this._anchor_0);
return new _View_TreeRootComponent1(this.viewUtils, this, 0, this._anchor_0);
}
}
@ -121,16 +115,6 @@ class _View_TreeRootComponent0 extends import1.AppView<import3.TreeRootComponent
this._appEl_0.detectChangesInNestedViews(throwOnChange);
}
}
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 = 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, {}));
}
return new _View_TreeRootComponent0(viewUtils, parentView, parentIndex, parentElement);
}
class _View_TreeRootComponent1 extends import1.AppView<any> {
_el_0: any;
_TreeComponent0_0_4View: any;
@ -155,8 +139,3 @@ class _View_TreeRootComponent1 extends import1.AppView<any> {
}
visitRootNodesInternal(cb: any, context: any) { cb(this._el_0, context); }
}
function viewFactory_TreeRootComponent1(
viewUtils: import4.ViewUtils, parentView: import1.AppView<any>, parentIndex: number,
parentElement: any): import1.AppView<any> {
return new _View_TreeRootComponent1(viewUtils, parentView, parentIndex, parentElement);
}