refactor(compiler): don’t use `AppElement`s for creating component views
This commit is contained in:
parent
13533d2a30
commit
d1035da85c
|
@ -73,7 +73,7 @@ export class CompileElement extends CompileNode {
|
||||||
this.instances.set(resolveIdentifierToken(Identifiers.Injector).reference, this.injector);
|
this.instances.set(resolveIdentifierToken(Identifiers.Injector).reference, this.injector);
|
||||||
this.instances.set(
|
this.instances.set(
|
||||||
resolveIdentifierToken(Identifiers.Renderer).reference, o.THIS_EXPR.prop('renderer'));
|
resolveIdentifierToken(Identifiers.Renderer).reference, o.THIS_EXPR.prop('renderer'));
|
||||||
if (this.hasViewContainer || this.hasEmbeddedView || isPresent(this.component)) {
|
if (this.hasViewContainer || this.hasEmbeddedView) {
|
||||||
this._createAppElement();
|
this._createAppElement();
|
||||||
}
|
}
|
||||||
if (this.component) {
|
if (this.component) {
|
||||||
|
|
|
@ -40,7 +40,9 @@ export class ChangeDetectorStatusEnum {
|
||||||
export class ViewConstructorVars {
|
export class ViewConstructorVars {
|
||||||
static viewUtils = o.variable('viewUtils');
|
static viewUtils = o.variable('viewUtils');
|
||||||
static parentInjector = o.variable('parentInjector');
|
static parentInjector = o.variable('parentInjector');
|
||||||
static declarationEl = o.variable('declarationEl');
|
static parentView = o.variable('parentView');
|
||||||
|
static parentIndex = o.variable('parentIndex');
|
||||||
|
static parentElement = o.variable('parentElement');
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ViewProperties {
|
export class ViewProperties {
|
||||||
|
|
|
@ -24,7 +24,7 @@ export function getPropertyInView(
|
||||||
var currView: CompileView = callingView;
|
var currView: CompileView = callingView;
|
||||||
while (currView !== definedView && isPresent(currView.declarationElement.view)) {
|
while (currView !== definedView && isPresent(currView.declarationElement.view)) {
|
||||||
currView = currView.declarationElement.view;
|
currView = currView.declarationElement.view;
|
||||||
viewProp = viewProp.prop('parent');
|
viewProp = viewProp.prop('parentView');
|
||||||
}
|
}
|
||||||
if (currView !== definedView) {
|
if (currView !== definedView) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
|
@ -233,10 +233,10 @@ class ViewBuilderVisitor implements TemplateAstVisitor {
|
||||||
o.importType(resolveIdentifier(Identifiers.AppView), [o.importType(component.type)])));
|
o.importType(resolveIdentifier(Identifiers.AppView), [o.importType(component.type)])));
|
||||||
this.view.viewChildren.push(compViewExpr);
|
this.view.viewChildren.push(compViewExpr);
|
||||||
compileElement.setComponentView(compViewExpr);
|
compileElement.setComponentView(compViewExpr);
|
||||||
this.view.createMethod.addStmt(
|
this.view.createMethod.addStmt(compViewExpr
|
||||||
compViewExpr
|
|
||||||
.set(o.importExpr(nestedComponentIdentifier).callFn([
|
.set(o.importExpr(nestedComponentIdentifier).callFn([
|
||||||
ViewProperties.viewUtils, compileElement.injector, compileElement.appElement
|
ViewProperties.viewUtils, compileElement.injector,
|
||||||
|
o.THIS_EXPR, o.literal(nodeIndex), renderNode
|
||||||
]))
|
]))
|
||||||
.toStmt());
|
.toStmt());
|
||||||
}
|
}
|
||||||
|
@ -442,13 +442,16 @@ function createViewClass(
|
||||||
ViewConstructorVars.parentInjector.name,
|
ViewConstructorVars.parentInjector.name,
|
||||||
o.importType(resolveIdentifier(Identifiers.Injector))),
|
o.importType(resolveIdentifier(Identifiers.Injector))),
|
||||||
new o.FnParam(
|
new o.FnParam(
|
||||||
ViewConstructorVars.declarationEl.name,
|
ViewConstructorVars.parentView.name,
|
||||||
o.importType(resolveIdentifier(Identifiers.AppElement)))
|
o.importType(resolveIdentifier(Identifiers.AppView), [o.DYNAMIC_TYPE])),
|
||||||
|
new o.FnParam(ViewConstructorVars.parentIndex.name, o.NUMBER_TYPE),
|
||||||
|
new o.FnParam(ViewConstructorVars.parentElement.name, o.DYNAMIC_TYPE)
|
||||||
];
|
];
|
||||||
var superConstructorArgs = [
|
var superConstructorArgs = [
|
||||||
o.variable(view.className), renderCompTypeVar, ViewTypeEnum.fromValue(view.viewType),
|
o.variable(view.className), renderCompTypeVar, ViewTypeEnum.fromValue(view.viewType),
|
||||||
ViewConstructorVars.viewUtils, ViewConstructorVars.parentInjector,
|
ViewConstructorVars.viewUtils, ViewConstructorVars.parentInjector,
|
||||||
ViewConstructorVars.declarationEl,
|
ViewConstructorVars.parentView, ViewConstructorVars.parentIndex,
|
||||||
|
ViewConstructorVars.parentElement,
|
||||||
ChangeDetectorStatusEnum.fromValue(getChangeDetectionMode(view))
|
ChangeDetectorStatusEnum.fromValue(getChangeDetectionMode(view))
|
||||||
];
|
];
|
||||||
if (view.genConfig.genDebugInfo) {
|
if (view.genConfig.genDebugInfo) {
|
||||||
|
@ -507,8 +510,10 @@ function createViewFactory(
|
||||||
ViewConstructorVars.parentInjector.name,
|
ViewConstructorVars.parentInjector.name,
|
||||||
o.importType(resolveIdentifier(Identifiers.Injector))),
|
o.importType(resolveIdentifier(Identifiers.Injector))),
|
||||||
new o.FnParam(
|
new o.FnParam(
|
||||||
ViewConstructorVars.declarationEl.name,
|
ViewConstructorVars.parentView.name,
|
||||||
o.importType(resolveIdentifier(Identifiers.AppElement)))
|
o.importType(resolveIdentifier(Identifiers.AppView), [o.DYNAMIC_TYPE])),
|
||||||
|
new o.FnParam(ViewConstructorVars.parentIndex.name, o.NUMBER_TYPE),
|
||||||
|
new o.FnParam(ViewConstructorVars.parentElement.name, o.DYNAMIC_TYPE)
|
||||||
];
|
];
|
||||||
var initRenderCompTypeStmts: any[] = [];
|
var initRenderCompTypeStmts: any[] = [];
|
||||||
var templateUrlInfo: string;
|
var templateUrlInfo: string;
|
||||||
|
@ -553,8 +558,8 @@ function generateCreateMethod(view: CompileView): o.Statement[] {
|
||||||
var parentRenderNodeExpr: o.Expression = o.NULL_EXPR;
|
var parentRenderNodeExpr: o.Expression = o.NULL_EXPR;
|
||||||
var parentRenderNodeStmts: any[] = [];
|
var parentRenderNodeStmts: any[] = [];
|
||||||
if (view.viewType === ViewType.COMPONENT) {
|
if (view.viewType === ViewType.COMPONENT) {
|
||||||
parentRenderNodeExpr = ViewProperties.renderer.callMethod(
|
parentRenderNodeExpr =
|
||||||
'createViewRoot', [o.THIS_EXPR.prop('declarationAppElement').prop('nativeElement')]);
|
ViewProperties.renderer.callMethod('createViewRoot', [o.THIS_EXPR.prop('parentElement')]);
|
||||||
parentRenderNodeStmts =
|
parentRenderNodeStmts =
|
||||||
[parentRenderNodeVar.set(parentRenderNodeExpr)
|
[parentRenderNodeVar.set(parentRenderNodeExpr)
|
||||||
.toDeclStmt(
|
.toDeclStmt(
|
||||||
|
|
|
@ -24,7 +24,7 @@ export function main() {
|
||||||
const definedView = createCompileView({className: 'parentView'});
|
const definedView = createCompileView({className: 'parentView'});
|
||||||
const callingView = createCompileView({className: 'childView', parent: definedView});
|
const callingView = createCompileView({className: 'childView', parent: definedView});
|
||||||
expect(getPropertyInView(expr, callingView, definedView))
|
expect(getPropertyInView(expr, callingView, definedView))
|
||||||
.toEqual(o.THIS_EXPR.prop('parent').prop('someProp'));
|
.toEqual(o.THIS_EXPR.prop('parentView').prop('someProp'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should access a known property in a parent view with cast', () => {
|
it('should access a known property in a parent view with cast', () => {
|
||||||
|
@ -32,7 +32,7 @@ export function main() {
|
||||||
const definedView = createCompileView({className: 'parentView', fields: ['someProp']});
|
const definedView = createCompileView({className: 'parentView', fields: ['someProp']});
|
||||||
const callingView = createCompileView({className: 'childView', parent: definedView});
|
const callingView = createCompileView({className: 'childView', parent: definedView});
|
||||||
expect(getPropertyInView(expr, callingView, definedView))
|
expect(getPropertyInView(expr, callingView, definedView))
|
||||||
.toEqual(o.THIS_EXPR.prop('parent').cast(definedView.classType).prop('someProp'));
|
.toEqual(o.THIS_EXPR.prop('parentView').cast(definedView.classType).prop('someProp'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should access a known property in a parent view with cast also for property chain expressions',
|
it('should access a known property in a parent view with cast also for property chain expressions',
|
||||||
|
@ -41,7 +41,7 @@ export function main() {
|
||||||
const definedView = createCompileView({className: 'parentView', fields: ['someProp']});
|
const definedView = createCompileView({className: 'parentView', fields: ['someProp']});
|
||||||
const callingView = createCompileView({className: 'childView', parent: definedView});
|
const callingView = createCompileView({className: 'childView', parent: definedView});
|
||||||
expect(getPropertyInView(expr, callingView, definedView))
|
expect(getPropertyInView(expr, callingView, definedView))
|
||||||
.toEqual(o.THIS_EXPR.prop('parent')
|
.toEqual(o.THIS_EXPR.prop('parentView')
|
||||||
.cast(definedView.classType)
|
.cast(definedView.classType)
|
||||||
.prop('someProp')
|
.prop('someProp')
|
||||||
.prop('context'));
|
.prop('context'));
|
||||||
|
|
|
@ -109,8 +109,7 @@ export class ComponentFactory<C> {
|
||||||
if (!projectableNodes) {
|
if (!projectableNodes) {
|
||||||
projectableNodes = [];
|
projectableNodes = [];
|
||||||
}
|
}
|
||||||
// Note: Host views don't need a declarationAppElement!
|
var hostView: AppView<any> = this._viewFactory(vu, injector, null, null, null);
|
||||||
var hostView: AppView<any> = this._viewFactory(vu, injector, null);
|
|
||||||
// TODO: implement this in the View class directly?!
|
// TODO: implement this in the View class directly?!
|
||||||
// (behind a `if (this.type === ViewType.HOST)`)
|
// (behind a `if (this.type === ViewType.HOST)`)
|
||||||
// TODO: and pass the projectableNodes into `createHostView`
|
// TODO: and pass the projectableNodes into `createHostView`
|
||||||
|
|
|
@ -39,13 +39,10 @@ export class DebugContext implements RenderDebugInfo {
|
||||||
}
|
}
|
||||||
get componentRenderElement() {
|
get componentRenderElement() {
|
||||||
var componentView = this._view;
|
var componentView = this._view;
|
||||||
while (isPresent(componentView.declarationAppElement) &&
|
while (isPresent(componentView.parentView) && componentView.type !== ViewType.COMPONENT) {
|
||||||
componentView.type !== ViewType.COMPONENT) {
|
componentView = <DebugAppView<any>>componentView.parentView;
|
||||||
componentView = <DebugAppView<any>>componentView.declarationAppElement.parentView;
|
|
||||||
}
|
}
|
||||||
return isPresent(componentView.declarationAppElement) ?
|
return componentView.parentElement;
|
||||||
componentView.declarationAppElement.nativeElement :
|
|
||||||
null;
|
|
||||||
}
|
}
|
||||||
get injector(): Injector { return this._view.injector(this._nodeIndex); }
|
get injector(): Injector { return this._view.injector(this._nodeIndex); }
|
||||||
get renderNode(): any {
|
get renderNode(): any {
|
||||||
|
|
|
@ -47,7 +47,8 @@ export class TemplateRef_<C> extends TemplateRef<C> {
|
||||||
|
|
||||||
createEmbeddedView(context: C): EmbeddedViewRef<C> {
|
createEmbeddedView(context: C): EmbeddedViewRef<C> {
|
||||||
var view: AppView<C> = this._viewFactory(
|
var view: AppView<C> = this._viewFactory(
|
||||||
this._appElement.parentView.viewUtils, this._appElement.parentInjector, this._appElement);
|
this._appElement.parentView.viewUtils, this._appElement.parentInjector,
|
||||||
|
this._appElement.parentView, this._appElement.index, this._appElement.nativeElement);
|
||||||
view.create(context || <any>{});
|
view.create(context || <any>{});
|
||||||
return view.ref;
|
return view.ref;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,13 +52,13 @@ export abstract class AppView<T> {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public clazz: any, public componentType: RenderComponentType, public type: ViewType,
|
public clazz: any, public componentType: RenderComponentType, public type: ViewType,
|
||||||
public viewUtils: ViewUtils, public parentInjector: Injector,
|
public viewUtils: ViewUtils, public parentInjector: Injector, public parentView: AppView<any>,
|
||||||
public declarationAppElement: AppElement, public cdMode: ChangeDetectorStatus) {
|
public parentIndex: number, public parentElement: any, public cdMode: ChangeDetectorStatus) {
|
||||||
this.ref = new ViewRef_(this);
|
this.ref = new ViewRef_(this);
|
||||||
if (type === ViewType.COMPONENT || type === ViewType.HOST) {
|
if (type === ViewType.COMPONENT || type === ViewType.HOST) {
|
||||||
this.renderer = viewUtils.renderComponent(componentType);
|
this.renderer = viewUtils.renderComponent(componentType);
|
||||||
} else {
|
} else {
|
||||||
this.renderer = declarationAppElement.parentView.renderer;
|
this.renderer = parentView.renderer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,8 +129,7 @@ export abstract class AppView<T> {
|
||||||
if (this.cdMode === ChangeDetectorStatus.Destroyed) {
|
if (this.cdMode === ChangeDetectorStatus.Destroyed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var hostElement =
|
var hostElement = this.type === ViewType.COMPONENT ? this.parentElement : null;
|
||||||
this.type === ViewType.COMPONENT ? this.declarationAppElement.nativeElement : null;
|
|
||||||
if (this.disposables) {
|
if (this.disposables) {
|
||||||
for (var i = 0; i < this.disposables.length; i++) {
|
for (var i = 0; i < this.disposables.length; i++) {
|
||||||
this.disposables[i]();
|
this.disposables[i]();
|
||||||
|
@ -171,10 +170,6 @@ export abstract class AppView<T> {
|
||||||
|
|
||||||
get changeDetectorRef(): ChangeDetectorRef { return this.ref; }
|
get changeDetectorRef(): ChangeDetectorRef { return this.ref; }
|
||||||
|
|
||||||
get parent(): AppView<any> {
|
|
||||||
return isPresent(this.declarationAppElement) ? this.declarationAppElement.parentView : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
get flatRootNodes(): any[] {
|
get flatRootNodes(): any[] {
|
||||||
const nodes: any[] = [];
|
const nodes: any[] = [];
|
||||||
this.visitRootNodesInternal(addToArray, nodes);
|
this.visitRootNodesInternal(addToArray, nodes);
|
||||||
|
@ -188,13 +183,12 @@ export abstract class AppView<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
visitProjectedNodes<C>(ngContentIndex: number, cb: (node: any, ctx: C) => void, c: C): void {
|
visitProjectedNodes<C>(ngContentIndex: number, cb: (node: any, ctx: C) => void, c: C): void {
|
||||||
const appEl = this.declarationAppElement;
|
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case ViewType.EMBEDDED:
|
case ViewType.EMBEDDED:
|
||||||
appEl.parentView.visitProjectedNodes(ngContentIndex, cb, c);
|
this.parentView.visitProjectedNodes(ngContentIndex, cb, c);
|
||||||
break;
|
break;
|
||||||
case ViewType.COMPONENT:
|
case ViewType.COMPONENT:
|
||||||
appEl.parentView.visitProjectableNodesInternal(appEl.index, ngContentIndex, cb, c);
|
this.parentView.visitProjectableNodesInternal(this.parentIndex, ngContentIndex, cb, c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,9 +250,11 @@ export abstract class AppView<T> {
|
||||||
if (c.cdMode === ChangeDetectorStatus.Checked) {
|
if (c.cdMode === ChangeDetectorStatus.Checked) {
|
||||||
c.cdMode = ChangeDetectorStatus.CheckOnce;
|
c.cdMode = ChangeDetectorStatus.CheckOnce;
|
||||||
}
|
}
|
||||||
let parentEl =
|
if (c.type === ViewType.COMPONENT) {
|
||||||
c.type === ViewType.COMPONENT ? c.declarationAppElement : c.viewContainerElement;
|
c = c.parentView;
|
||||||
c = isPresent(parentEl) ? parentEl.parentView : null;
|
} else {
|
||||||
|
c = c.viewContainerElement ? c.viewContainerElement.parentView : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,9 +270,11 @@ export class DebugAppView<T> extends AppView<T> {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
clazz: any, componentType: RenderComponentType, type: ViewType, viewUtils: ViewUtils,
|
clazz: any, componentType: RenderComponentType, type: ViewType, viewUtils: ViewUtils,
|
||||||
parentInjector: Injector, declarationAppElement: AppElement, cdMode: ChangeDetectorStatus,
|
parentInjector: Injector, parentView: AppView<any>, parentIndex: number, parentNode: any,
|
||||||
public staticNodeDebugInfos: StaticNodeDebugInfo[]) {
|
cdMode: ChangeDetectorStatus, public staticNodeDebugInfos: StaticNodeDebugInfo[]) {
|
||||||
super(clazz, componentType, type, viewUtils, parentInjector, declarationAppElement, cdMode);
|
super(
|
||||||
|
clazz, componentType, type, viewUtils, parentInjector, parentView, parentIndex, parentNode,
|
||||||
|
cdMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
create(context: T) {
|
create(context: T) {
|
||||||
|
|
|
@ -27,10 +27,11 @@ class _View_TreeComponent_Host0 extends import1.AppView<any> {
|
||||||
_TreeComponent_0_4: _View_TreeComponent0;
|
_TreeComponent_0_4: _View_TreeComponent0;
|
||||||
constructor(
|
constructor(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement) {
|
parentView: import1.AppView<any>, parentIndex: number, parentElement: any) {
|
||||||
super(
|
super(
|
||||||
_View_TreeComponent_Host0, renderType_TreeComponent_Host, import6.ViewType.HOST, viewUtils,
|
_View_TreeComponent_Host0, renderType_TreeComponent_Host, import6.ViewType.HOST, viewUtils,
|
||||||
parentInjector, declarationEl, import7.ChangeDetectorStatus.CheckAlways);
|
parentInjector, parentView, parentIndex, parentElement,
|
||||||
|
import7.ChangeDetectorStatus.CheckAlways);
|
||||||
}
|
}
|
||||||
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
||||||
this._el_0 = import4.selectOrCreateRenderHostElement(
|
this._el_0 = import4.selectOrCreateRenderHostElement(
|
||||||
|
@ -53,12 +54,14 @@ class _View_TreeComponent_Host0 extends import1.AppView<any> {
|
||||||
}
|
}
|
||||||
function viewFactory_TreeComponent_Host0(
|
function viewFactory_TreeComponent_Host0(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement): import1.AppView<any> {
|
parentView: import1.AppView<any>, parentIndex: number,
|
||||||
|
parentElement: any): import1.AppView<any> {
|
||||||
if ((renderType_TreeComponent_Host === (null as any))) {
|
if ((renderType_TreeComponent_Host === (null as any))) {
|
||||||
(renderType_TreeComponent_Host =
|
(renderType_TreeComponent_Host =
|
||||||
viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
|
viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
|
||||||
}
|
}
|
||||||
return new _View_TreeComponent_Host0(viewUtils, parentInjector, declarationEl);
|
return new _View_TreeComponent_Host0(
|
||||||
|
viewUtils, parentInjector, parentView, parentIndex, parentElement);
|
||||||
}
|
}
|
||||||
export const TreeComponentNgFactory: import9.ComponentFactory<import3.TreeComponent> =
|
export const TreeComponentNgFactory: import9.ComponentFactory<import3.TreeComponent> =
|
||||||
new import9.ComponentFactory<import3.TreeComponent>(
|
new import9.ComponentFactory<import3.TreeComponent>(
|
||||||
|
|
|
@ -30,17 +30,18 @@ class _View_TreeRootComponent_Host0 extends import1.AppView<any> {
|
||||||
_TreeRootComponent_0_4_View: any;
|
_TreeRootComponent_0_4_View: any;
|
||||||
constructor(
|
constructor(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement) {
|
parentView: import1.AppView<any>, parentIndex: number, parentElement: any) {
|
||||||
super(
|
super(
|
||||||
_View_TreeRootComponent_Host0, renderType_TreeRootComponent_Host, import6.ViewType.HOST,
|
_View_TreeRootComponent_Host0, renderType_TreeRootComponent_Host, import6.ViewType.HOST,
|
||||||
viewUtils, parentInjector, declarationEl, import7.ChangeDetectorStatus.CheckAlways);
|
viewUtils, parentInjector, parentView, parentIndex, parentElement,
|
||||||
|
import7.ChangeDetectorStatus.CheckAlways);
|
||||||
}
|
}
|
||||||
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
||||||
this._el_0 = import4.selectOrCreateRenderHostElement(
|
this._el_0 = import4.selectOrCreateRenderHostElement(
|
||||||
this.renderer, 'tree', import4.EMPTY_INLINE_ARRAY, rootSelector, (null as any));
|
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);
|
this._appEl_0 = new import2.AppElement(0, (null as any), this, this._el_0);
|
||||||
this._TreeRootComponent_0_4_View =
|
this._TreeRootComponent_0_4_View =
|
||||||
viewFactory_TreeRootComponent0(this.viewUtils, this.injector(0), this._appEl_0);
|
viewFactory_TreeRootComponent0(this.viewUtils, this.injector(0), this, 0, this._el_0);
|
||||||
this._TreeRootComponent_0_4 = new import3.TreeRootComponent();
|
this._TreeRootComponent_0_4 = new import3.TreeRootComponent();
|
||||||
this._TreeRootComponent_0_4_View.create(this._TreeRootComponent_0_4, (null as any));
|
this._TreeRootComponent_0_4_View.create(this._TreeRootComponent_0_4, (null as any));
|
||||||
this.init([].concat([this._el_0]), [this._el_0], []);
|
this.init([].concat([this._el_0]), [this._el_0], []);
|
||||||
|
@ -59,12 +60,14 @@ class _View_TreeRootComponent_Host0 extends import1.AppView<any> {
|
||||||
}
|
}
|
||||||
function viewFactory_TreeRootComponent_Host0(
|
function viewFactory_TreeRootComponent_Host0(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement): import1.AppView<any> {
|
parentView: import1.AppView<any>, parentIndex: number,
|
||||||
|
parentElement: any): import1.AppView<any> {
|
||||||
if ((renderType_TreeRootComponent_Host === (null as any))) {
|
if ((renderType_TreeRootComponent_Host === (null as any))) {
|
||||||
(renderType_TreeRootComponent_Host =
|
(renderType_TreeRootComponent_Host =
|
||||||
viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
|
viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
|
||||||
}
|
}
|
||||||
return new _View_TreeRootComponent_Host0(viewUtils, parentInjector, declarationEl);
|
return new _View_TreeRootComponent_Host0(
|
||||||
|
viewUtils, parentInjector, parentView, parentIndex, parentElement);
|
||||||
}
|
}
|
||||||
export const TreeRootComponentNgFactory: import9.ComponentFactory<import3.TreeRootComponent> =
|
export const TreeRootComponentNgFactory: import9.ComponentFactory<import3.TreeRootComponent> =
|
||||||
new import9.ComponentFactory<import3.TreeRootComponent>(
|
new import9.ComponentFactory<import3.TreeRootComponent>(
|
||||||
|
@ -79,14 +82,14 @@ class _View_TreeRootComponent0 extends import1.AppView<import3.TreeRootComponent
|
||||||
/*private*/ _expr_0: any;
|
/*private*/ _expr_0: any;
|
||||||
constructor(
|
constructor(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement) {
|
parentView: import1.AppView<any>, parentIndex: number, parentElement: any) {
|
||||||
super(
|
super(
|
||||||
_View_TreeRootComponent0, renderType_TreeRootComponent, import6.ViewType.COMPONENT,
|
_View_TreeRootComponent0, renderType_TreeRootComponent, import6.ViewType.COMPONENT,
|
||||||
viewUtils, parentInjector, declarationEl, import7.ChangeDetectorStatus.CheckAlways);
|
viewUtils, parentInjector, parentView, parentIndex, parentElement,
|
||||||
|
import7.ChangeDetectorStatus.CheckAlways);
|
||||||
}
|
}
|
||||||
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
||||||
const parentRenderNode: any =
|
const parentRenderNode: any = this.renderer.createViewRoot(this.parentElement);
|
||||||
this.renderer.createViewRoot(this.declarationAppElement.nativeElement);
|
|
||||||
this._anchor_0 = this.renderer.createTemplateAnchor(parentRenderNode, (null as any));
|
this._anchor_0 = this.renderer.createTemplateAnchor(parentRenderNode, (null as any));
|
||||||
this._appEl_0 = new import2.AppElement(0, (null as any), this, this._anchor_0);
|
this._appEl_0 = new import2.AppElement(0, (null as any), this, this._anchor_0);
|
||||||
this._TemplateRef_0_5 =
|
this._TemplateRef_0_5 =
|
||||||
|
@ -116,23 +119,26 @@ class _View_TreeRootComponent0 extends import1.AppView<import3.TreeRootComponent
|
||||||
}
|
}
|
||||||
export function viewFactory_TreeRootComponent0(
|
export function viewFactory_TreeRootComponent0(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement): import1.AppView<import3.TreeRootComponent> {
|
parentView: import1.AppView<any>, parentIndex: number,
|
||||||
|
parentElement: any): import1.AppView<import3.TreeRootComponent> {
|
||||||
if ((renderType_TreeRootComponent === (null as any))) {
|
if ((renderType_TreeRootComponent === (null as any))) {
|
||||||
(renderType_TreeRootComponent = viewUtils.createRenderComponentType(
|
(renderType_TreeRootComponent = viewUtils.createRenderComponentType(
|
||||||
'/Users/tbosch/projects/conf-demos/ngc-demo/src/ng2_static/root_tree.ts class TreeRootComponent - inline template',
|
'/Users/tbosch/projects/conf-demos/ngc-demo/src/ng2_static/root_tree.ts class TreeRootComponent - inline template',
|
||||||
0, import8.ViewEncapsulation.None, styles_TreeRootComponent, {}));
|
0, import8.ViewEncapsulation.None, styles_TreeRootComponent, {}));
|
||||||
}
|
}
|
||||||
return new _View_TreeRootComponent0(viewUtils, parentInjector, declarationEl);
|
return new _View_TreeRootComponent0(
|
||||||
|
viewUtils, parentInjector, parentView, parentIndex, parentElement);
|
||||||
}
|
}
|
||||||
class _View_TreeRootComponent1 extends import1.AppView<any> {
|
class _View_TreeRootComponent1 extends import1.AppView<any> {
|
||||||
_el_0: any;
|
_el_0: any;
|
||||||
_TreeComponent0_0_4View: any;
|
_TreeComponent0_0_4View: any;
|
||||||
constructor(
|
constructor(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement) {
|
parentView: import1.AppView<any>, parentIndex: number, parentElement: any) {
|
||||||
super(
|
super(
|
||||||
_View_TreeRootComponent1, renderType_TreeRootComponent, import6.ViewType.EMBEDDED,
|
_View_TreeRootComponent1, renderType_TreeRootComponent, import6.ViewType.EMBEDDED,
|
||||||
viewUtils, parentInjector, declarationEl, import7.ChangeDetectorStatus.CheckAlways);
|
viewUtils, parentInjector, parentView, parentIndex, parentElement,
|
||||||
|
import7.ChangeDetectorStatus.CheckAlways);
|
||||||
}
|
}
|
||||||
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
createInternal(rootSelector: string): import9.ComponentRef<any> {
|
||||||
this._el_0 = this.renderer.createElement((null as any), 'tree0', (null as any));
|
this._el_0 = this.renderer.createElement((null as any), 'tree0', (null as any));
|
||||||
|
@ -142,13 +148,15 @@ class _View_TreeRootComponent1 extends import1.AppView<any> {
|
||||||
}
|
}
|
||||||
destroyInternal() { this._TreeComponent0_0_4View.destroyInternal(); }
|
destroyInternal() { this._TreeComponent0_0_4View.destroyInternal(); }
|
||||||
detectChangesInternal(throwOnChange: boolean): void {
|
detectChangesInternal(throwOnChange: boolean): void {
|
||||||
this._TreeComponent0_0_4View.updateData(this.parent.context.data);
|
this._TreeComponent0_0_4View.updateData(this.parentView.context.data);
|
||||||
this._TreeComponent0_0_4View.detectChangesInternal(throwOnChange);
|
this._TreeComponent0_0_4View.detectChangesInternal(throwOnChange);
|
||||||
}
|
}
|
||||||
visitRootNodesInternal(cb: any, context: any) { cb(this._el_0, context); }
|
visitRootNodesInternal(cb: any, context: any) { cb(this._el_0, context); }
|
||||||
}
|
}
|
||||||
function viewFactory_TreeRootComponent1(
|
function viewFactory_TreeRootComponent1(
|
||||||
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
viewUtils: import4.ViewUtils, parentInjector: import5.Injector,
|
||||||
declarationEl: import2.AppElement): import1.AppView<any> {
|
parentView: import1.AppView<any>, parentIndex: number,
|
||||||
return new _View_TreeRootComponent1(viewUtils, parentInjector, declarationEl);
|
parentElement: any): import1.AppView<any> {
|
||||||
|
return new _View_TreeRootComponent1(
|
||||||
|
viewUtils, parentInjector, parentView, parentIndex, parentElement);
|
||||||
}
|
}
|
Loading…
Reference in New Issue