refactor(ivy): remove unnecessary Comp.r function (#21650)
PR Close #21650
This commit is contained in:
parent
2c33d17609
commit
811679a583
|
@ -6,7 +6,7 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {ɵC as C, ɵE as E, ɵT as T, ɵV as V, ɵb as b, ɵb1 as b1, ɵcR as cR, ɵcr as cr, ɵdefineComponent as defineComponent, ɵdetectChanges as _detectChanges, ɵe as e, ɵp as p, ɵs as s, ɵt as t, ɵv as v} from '@angular/core';
|
import {ɵC as C, ɵE as E, ɵT as T, ɵV as V, ɵb as b, ɵb1 as b1, ɵcR as cR, ɵcr as cr, ɵdefineComponent as defineComponent, ɵdetectChanges as _detectChanges, ɵe as e, ɵp as p, ɵr as r, ɵs as s, ɵt as t, ɵv as v} from '@angular/core';
|
||||||
import {ComponentDef} from '@angular/core/src/render3/interfaces/definition';
|
import {ComponentDef} from '@angular/core/src/render3/interfaces/definition';
|
||||||
|
|
||||||
import {TreeNode, buildTree, emptyTree} from '../util';
|
import {TreeNode, buildTree, emptyTree} from '../util';
|
||||||
|
@ -59,7 +59,7 @@ export class TreeComponent {
|
||||||
}
|
}
|
||||||
p(0, 'data', b(ctx.data.left));
|
p(0, 'data', b(ctx.data.left));
|
||||||
TreeComponent.ngComponentDef.h(1, 0);
|
TreeComponent.ngComponentDef.h(1, 0);
|
||||||
TreeComponent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ export class TreeComponent {
|
||||||
}
|
}
|
||||||
p(0, 'data', b(ctx.data.right));
|
p(0, 'data', b(ctx.data.right));
|
||||||
TreeComponent.ngComponentDef.h(1, 0);
|
TreeComponent.ngComponentDef.h(1, 0);
|
||||||
TreeComponent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,8 +205,8 @@ describe('r3_view_compiler', () => {
|
||||||
IDENT.ɵe();
|
IDENT.ɵe();
|
||||||
IDENT.ɵT(3, '!');
|
IDENT.ɵT(3, '!');
|
||||||
}
|
}
|
||||||
ChildComponent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
SomeDirective.ngDirectiveDef.r(2, 0);
|
r(2, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
`;
|
`;
|
||||||
|
@ -267,7 +267,7 @@ describe('r3_view_compiler', () => {
|
||||||
}
|
}
|
||||||
const IDENT = IDENT.ɵm(1);
|
const IDENT = IDENT.ɵm(1);
|
||||||
IDENT.ɵcR(2);
|
IDENT.ɵcR(2);
|
||||||
IfDirective.ngDirectiveDef.r(3,2);
|
r(3,2);
|
||||||
IDENT.ɵcr();
|
IDENT.ɵcr();
|
||||||
|
|
||||||
function MyComponent_IfDirective_Template_2(ctx0: IDENT, cm: IDENT) {
|
function MyComponent_IfDirective_Template_2(ctx0: IDENT, cm: IDENT) {
|
||||||
|
|
|
@ -34,5 +34,6 @@ export {
|
||||||
s as ɵs,
|
s as ɵs,
|
||||||
t as ɵt,
|
t as ɵt,
|
||||||
v as ɵv,
|
v as ɵv,
|
||||||
|
r as ɵr,
|
||||||
} from './render3/index';
|
} from './render3/index';
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
|
@ -40,11 +40,6 @@ export function defineComponent<T>(componentDefinition: ComponentDefArgs<T>): Co
|
||||||
n: componentDefinition.factory,
|
n: componentDefinition.factory,
|
||||||
tag: (componentDefinition as ComponentDefArgs<T>).tag || null !,
|
tag: (componentDefinition as ComponentDefArgs<T>).tag || null !,
|
||||||
template: (componentDefinition as ComponentDefArgs<T>).template || null !,
|
template: (componentDefinition as ComponentDefArgs<T>).template || null !,
|
||||||
r: componentDefinition.refresh || (componentDefinition.template ?
|
|
||||||
function(d: number, e: number) {
|
|
||||||
componentRefresh(d, e, componentDefinition.template);
|
|
||||||
} :
|
|
||||||
noop),
|
|
||||||
h: componentDefinition.hostBindings || noop,
|
h: componentDefinition.hostBindings || noop,
|
||||||
inputs: invertObject(componentDefinition.inputs),
|
inputs: invertObject(componentDefinition.inputs),
|
||||||
outputs: invertObject(componentDefinition.outputs),
|
outputs: invertObject(componentDefinition.outputs),
|
||||||
|
|
|
@ -337,8 +337,8 @@ export function renderComponentOrTemplate<T>(
|
||||||
template(componentOrContext !, creationMode);
|
template(componentOrContext !, creationMode);
|
||||||
} else {
|
} else {
|
||||||
// Element was stored at 0 and directive was stored at 1 in renderComponent
|
// Element was stored at 0 and directive was stored at 1 in renderComponent
|
||||||
// so to refresh the component, r() needs to be called with (1, 0)
|
// so to refresh the component, refresh() needs to be called with (1, 0)
|
||||||
(componentOrContext.constructor as ComponentType<T>).ngComponentDef.r(1, 0);
|
componentRefresh(1, 0);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (rendererFactory.end) {
|
if (rendererFactory.end) {
|
||||||
|
@ -1161,28 +1161,27 @@ export function viewEnd(): void {
|
||||||
*
|
*
|
||||||
* @param directiveIndex
|
* @param directiveIndex
|
||||||
* @param elementIndex
|
* @param elementIndex
|
||||||
* @param template
|
|
||||||
*/
|
*/
|
||||||
export const componentRefresh:
|
export function componentRefresh<T>(directiveIndex: number, elementIndex: number): void {
|
||||||
<T>(directiveIndex: number, elementIndex: number, template: ComponentTemplate<T>) =>
|
|
||||||
void = function<T>(
|
|
||||||
directiveIndex: number, elementIndex: number, template: ComponentTemplate<T>) {
|
|
||||||
ngDevMode && assertDataInRange(elementIndex);
|
|
||||||
const element = data ![elementIndex] as LElementNode;
|
|
||||||
ngDevMode && assertNodeOfPossibleTypes(element, LNodeFlags.Element, LNodeFlags.Container);
|
|
||||||
ngDevMode && assertNotEqual(element.data, null, 'isComponent');
|
|
||||||
ngDevMode && assertDataInRange(directiveIndex);
|
|
||||||
const hostView = element.data !;
|
|
||||||
ngDevMode && assertNotEqual(hostView, null, 'hostView');
|
|
||||||
executeInitHooks(currentView);
|
executeInitHooks(currentView);
|
||||||
executeContentHooks(currentView);
|
executeContentHooks(currentView);
|
||||||
const directive = data[directiveIndex];
|
const template = (tData[directiveIndex] as ComponentDef<T>).template;
|
||||||
const oldView = enterView(hostView, element);
|
if (template != null) {
|
||||||
try {
|
ngDevMode && assertDataInRange(elementIndex);
|
||||||
template(directive, creationMode);
|
const element = data ![elementIndex] as LElementNode;
|
||||||
} finally {
|
ngDevMode && assertNodeType(element, LNodeFlags.Element);
|
||||||
refreshDynamicChildren();
|
ngDevMode && assertNotEqual(element.data, null, 'isComponent');
|
||||||
leaveView(oldView);
|
ngDevMode && assertDataInRange(directiveIndex);
|
||||||
|
const directive = data[directiveIndex];
|
||||||
|
const hostView = element.data !;
|
||||||
|
ngDevMode && assertNotEqual(hostView, null, 'hostView');
|
||||||
|
const oldView = enterView(hostView, element);
|
||||||
|
try {
|
||||||
|
template(directive, creationMode);
|
||||||
|
} finally {
|
||||||
|
refreshDynamicChildren();
|
||||||
|
leaveView(oldView);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -67,18 +67,6 @@ export interface DirectiveDef<T> {
|
||||||
*/
|
*/
|
||||||
n(): T;
|
n(): T;
|
||||||
|
|
||||||
/**
|
|
||||||
* Refreshes the view of the component. Also calls lifecycle hooks like
|
|
||||||
* ngAfterViewInit, if they are defined on the component.
|
|
||||||
*
|
|
||||||
* NOTE: this property is short (1 char) because it is used in component
|
|
||||||
* templates which is sensitive to size.
|
|
||||||
*
|
|
||||||
* @param directiveIndex index of the directive in the containing template
|
|
||||||
* @param elementIndex index of an host element for a given directive.
|
|
||||||
*/
|
|
||||||
r(directiveIndex: number, elementIndex: number): void;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refreshes host bindings on the associated directive. Also calls lifecycle hooks
|
* Refreshes host bindings on the associated directive. Also calls lifecycle hooks
|
||||||
* like ngOnInit and ngDoCheck, if they are defined on the directive.
|
* like ngOnInit and ngDoCheck, if they are defined on the directive.
|
||||||
|
@ -94,18 +82,6 @@ export interface DirectiveDef<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentDef<T> extends DirectiveDef<T> {
|
export interface ComponentDef<T> extends DirectiveDef<T> {
|
||||||
/**
|
|
||||||
* Refreshes the view of the component. Also calls lifecycle hooks like
|
|
||||||
* ngAfterViewInit, if they are defined on the component.
|
|
||||||
*
|
|
||||||
* NOTE: this property is short (1 char) because it is used in
|
|
||||||
* component templates which is sensitive to size.
|
|
||||||
*
|
|
||||||
* @param directiveIndex index of the directive in the containing template
|
|
||||||
* @param elementIndex index of an host element for a given component.
|
|
||||||
*/
|
|
||||||
r(directiveIndex: number, elementIndex: number): void;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The tag name which should be used by the component.
|
* The tag name which should be used by the component.
|
||||||
*
|
*
|
||||||
|
@ -142,19 +118,17 @@ export interface LifecycleHooksMap {
|
||||||
export interface DirectiveDefArgs<T> {
|
export interface DirectiveDefArgs<T> {
|
||||||
type: Type<T>;
|
type: Type<T>;
|
||||||
factory: () => T;
|
factory: () => T;
|
||||||
refresh?: (directiveIndex: number, elementIndex: number) => void;
|
|
||||||
inputs?: {[P in keyof T]?: string};
|
inputs?: {[P in keyof T]?: string};
|
||||||
outputs?: {[P in keyof T]?: string};
|
outputs?: {[P in keyof T]?: string};
|
||||||
methods?: {[P in keyof T]?: string};
|
methods?: {[P in keyof T]?: string};
|
||||||
features?: DirectiveDefFeature[];
|
features?: DirectiveDefFeature[];
|
||||||
|
hostBindings?: (directiveIndex: number, elementIndex: number) => void;
|
||||||
exportAs?: string;
|
exportAs?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentDefArgs<T> extends DirectiveDefArgs<T> {
|
export interface ComponentDefArgs<T> extends DirectiveDefArgs<T> {
|
||||||
tag: string;
|
tag: string;
|
||||||
template: ComponentTemplate<T>;
|
template: ComponentTemplate<T>;
|
||||||
refresh?: (directiveIndex: number, elementIndex: number) => void;
|
|
||||||
hostBindings?: (directiveIndex: number, elementIndex: number) => void;
|
|
||||||
features?: ComponentDefFeature[];
|
features?: ComponentDefFeature[];
|
||||||
rendererType?: RendererType2;
|
rendererType?: RendererType2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,8 +98,8 @@ describe('compiler specification', () => {
|
||||||
r3.e();
|
r3.e();
|
||||||
r3.T(3, '!');
|
r3.T(3, '!');
|
||||||
}
|
}
|
||||||
ChildComponent.ngComponentDef.r(1, 0);
|
r3.r(1, 0);
|
||||||
SomeDirective.ngDirectiveDef.r(2, 0);
|
r3.r(2, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// /NORMATIVE
|
// /NORMATIVE
|
||||||
|
@ -146,7 +146,7 @@ describe('compiler specification', () => {
|
||||||
}
|
}
|
||||||
let foo = r3.m<any>(1);
|
let foo = r3.m<any>(1);
|
||||||
r3.cR(2);
|
r3.cR(2);
|
||||||
IfDirective.ngDirectiveDef.r(3, 2);
|
r3.r(3, 2);
|
||||||
r3.cr();
|
r3.cr();
|
||||||
|
|
||||||
function C1(ctx1: any, cm: boolean) {
|
function C1(ctx1: any, cm: boolean) {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {ViewEncapsulation} from '../../src/core';
|
import {ViewEncapsulation} from '../../src/core';
|
||||||
import {E, T, b, defineComponent, e, markDirty, t} from '../../src/render3/index';
|
import {E, T, b, defineComponent, e, markDirty, r, t} from '../../src/render3/index';
|
||||||
import {createRendererType2} from '../../src/view/index';
|
import {createRendererType2} from '../../src/view/index';
|
||||||
|
|
||||||
import {getRendererFactory2} from './imported_renderer2';
|
import {getRendererFactory2} from './imported_renderer2';
|
||||||
|
@ -72,7 +72,7 @@ describe('encapsulation', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
EncapsulatedComponent.ngComponentDef.h(1, 0);
|
EncapsulatedComponent.ngComponentDef.h(1, 0);
|
||||||
EncapsulatedComponent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
},
|
},
|
||||||
factory: () => new WrapperComponent,
|
factory: () => new WrapperComponent,
|
||||||
});
|
});
|
||||||
|
@ -89,7 +89,7 @@ describe('encapsulation', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
LeafComponent.ngComponentDef.h(2, 1);
|
LeafComponent.ngComponentDef.h(2, 1);
|
||||||
LeafComponent.ngComponentDef.r(2, 1);
|
r(2, 1);
|
||||||
},
|
},
|
||||||
factory: () => new EncapsulatedComponent,
|
factory: () => new EncapsulatedComponent,
|
||||||
rendererType:
|
rendererType:
|
||||||
|
@ -137,7 +137,7 @@ describe('encapsulation', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
LeafComponentwith.ngComponentDef.h(1, 0);
|
LeafComponentwith.ngComponentDef.h(1, 0);
|
||||||
LeafComponentwith.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
},
|
},
|
||||||
factory: () => new WrapperComponentWith,
|
factory: () => new WrapperComponentWith,
|
||||||
rendererType:
|
rendererType:
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {C, E, P, T, V, cR, cr, detectChanges, e, m, pD, v} from '../../src/render3/index';
|
import {C, E, P, T, V, cR, cr, detectChanges, e, m, pD, r, v} from '../../src/render3/index';
|
||||||
|
|
||||||
import {createComponent, renderComponent, toHtml} from './render_util';
|
import {createComponent, renderComponent, toHtml} from './render_util';
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child><div>content</div></child>');
|
expect(toHtml(parent)).toEqual('<child><div>content</div></child>');
|
||||||
|
@ -55,7 +55,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child>content</child>');
|
expect(toHtml(parent)).toEqual('<child>content</child>');
|
||||||
|
@ -77,7 +77,7 @@ describe('content projection', () => {
|
||||||
{ P(3, 0); }
|
{ P(3, 0); }
|
||||||
e();
|
e();
|
||||||
GrandChild.ngComponentDef.h(2, 1);
|
GrandChild.ngComponentDef.h(2, 1);
|
||||||
GrandChild.ngComponentDef.r(2, 1);
|
r(2, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const Parent = createComponent('parent', function(ctx: any, cm: boolean) {
|
const Parent = createComponent('parent', function(ctx: any, cm: boolean) {
|
||||||
|
@ -92,7 +92,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent))
|
expect(toHtml(parent))
|
||||||
|
@ -133,8 +133,8 @@ describe('content projection', () => {
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent))
|
expect(toHtml(parent))
|
||||||
|
@ -171,7 +171,7 @@ describe('content projection', () => {
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child><div>()</div></child>');
|
expect(toHtml(parent)).toEqual('<child><div>()</div></child>');
|
||||||
|
@ -207,7 +207,7 @@ describe('content projection', () => {
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child></child>');
|
expect(toHtml(parent)).toEqual('<child></child>');
|
||||||
|
@ -256,7 +256,7 @@ describe('content projection', () => {
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child><div>(else)</div></child>');
|
expect(toHtml(parent)).toEqual('<child><div>(else)</div></child>');
|
||||||
|
@ -314,7 +314,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child><div><span>content</span></div></child>');
|
expect(toHtml(parent)).toEqual('<child><div><span>content</span></div></child>');
|
||||||
|
@ -367,7 +367,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child><div>content</div></child>');
|
expect(toHtml(parent)).toEqual('<child><div>content</div></child>');
|
||||||
|
@ -404,7 +404,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child><div></div><span>content</span></child>');
|
expect(toHtml(parent)).toEqual('<child><div></div><span>content</span></child>');
|
||||||
|
@ -462,7 +462,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child>content<div></div></child>');
|
expect(toHtml(parent)).toEqual('<child>content<div></div></child>');
|
||||||
|
@ -511,7 +511,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
|
@ -557,7 +557,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
|
@ -603,7 +603,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
|
@ -649,7 +649,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
|
@ -696,7 +696,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
|
@ -743,8 +743,8 @@ describe('content projection', () => {
|
||||||
}
|
}
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(0, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(0, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
|
@ -792,7 +792,7 @@ describe('content projection', () => {
|
||||||
}
|
}
|
||||||
e();
|
e();
|
||||||
GrandChild.ngComponentDef.h(2, 1);
|
GrandChild.ngComponentDef.h(2, 1);
|
||||||
GrandChild.ngComponentDef.r(2, 1);
|
r(2, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -814,7 +814,7 @@ describe('content projection', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
|
@ -863,7 +863,7 @@ describe('content projection', () => {
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Child.ngComponentDef.h(1, 0);
|
Child.ngComponentDef.h(1, 0);
|
||||||
Child.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
const parent = renderComponent(Parent);
|
const parent = renderComponent(Parent);
|
||||||
expect(toHtml(parent)).toEqual('<child><span><div>content</div></span></child>');
|
expect(toHtml(parent)).toEqual('<child><span><div>content</div></span></child>');
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {E, b, defineDirective, e, m, p} from '../../src/render3/index';
|
import {E, b, defineDirective, e, m, p, r} from '../../src/render3/index';
|
||||||
|
|
||||||
import {renderToHtml} from './render_util';
|
import {renderToHtml} from './render_util';
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ describe('directive', () => {
|
||||||
static ngDirectiveDef = defineDirective({
|
static ngDirectiveDef = defineDirective({
|
||||||
type: Directive,
|
type: Directive,
|
||||||
factory: () => directiveInstance = new Directive,
|
factory: () => directiveInstance = new Directive,
|
||||||
refresh: (directiveIndex: number, elementIndex: number) => {
|
hostBindings: (directiveIndex: number, elementIndex: number) => {
|
||||||
p(elementIndex, 'className', b(m<Directive>(directiveIndex).klass));
|
p(elementIndex, 'className', b(m<Directive>(directiveIndex).klass));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -33,7 +33,8 @@ describe('directive', () => {
|
||||||
E(0, 'span', null, [Directive]);
|
E(0, 'span', null, [Directive]);
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Directive.ngDirectiveDef.r(1, 0);
|
Directive.ngDirectiveDef.h(1, 0);
|
||||||
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(renderToHtml(Template, {})).toEqual('<span class="foo"></span>');
|
expect(renderToHtml(Template, {})).toEqual('<span class="foo"></span>');
|
||||||
|
|
|
@ -234,7 +234,7 @@ describe('render3 integration test', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
TodoComponent.ngComponentDef.h(1, 0);
|
TodoComponent.ngComponentDef.h(1, 0);
|
||||||
TodoComponent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(renderToHtml(Template, null)).toEqual('<todo><p>Todo one</p></todo>');
|
expect(renderToHtml(Template, null)).toEqual('<todo><p>Todo one</p></todo>');
|
||||||
|
@ -248,7 +248,7 @@ describe('render3 integration test', () => {
|
||||||
T(2, 'two');
|
T(2, 'two');
|
||||||
}
|
}
|
||||||
TodoComponent.ngComponentDef.h(1, 0);
|
TodoComponent.ngComponentDef.h(1, 0);
|
||||||
TodoComponent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
expect(renderToHtml(Template, null)).toEqual('<todo><p>Todo one</p></todo>two');
|
expect(renderToHtml(Template, null)).toEqual('<todo><p>Todo one</p></todo>two');
|
||||||
});
|
});
|
||||||
|
@ -267,8 +267,8 @@ describe('render3 integration test', () => {
|
||||||
}
|
}
|
||||||
TodoComponent.ngComponentDef.h(1, 0);
|
TodoComponent.ngComponentDef.h(1, 0);
|
||||||
TodoComponent.ngComponentDef.h(3, 2);
|
TodoComponent.ngComponentDef.h(3, 2);
|
||||||
TodoComponent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
TodoComponent.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
}
|
}
|
||||||
expect(renderToHtml(Template, null))
|
expect(renderToHtml(Template, null))
|
||||||
.toEqual('<todo><p>Todo one</p></todo><todo><p>Todo one</p></todo>');
|
.toEqual('<todo><p>Todo one</p></todo><todo><p>Todo one</p></todo>');
|
||||||
|
@ -303,7 +303,7 @@ describe('render3 integration test', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
TodoComponentHostBinding.ngComponentDef.h(1, 0);
|
TodoComponentHostBinding.ngComponentDef.h(1, 0);
|
||||||
TodoComponentHostBinding.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(renderToHtml(Template, {})).toEqual('<todo title="one">one</todo>');
|
expect(renderToHtml(Template, {})).toEqual('<todo title="one">one</todo>');
|
||||||
|
@ -336,7 +336,7 @@ describe('render3 integration test', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
MyComp.ngComponentDef.h(1, 0);
|
MyComp.ngComponentDef.h(1, 0);
|
||||||
MyComp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(renderToHtml(Template, null)).toEqual('<comp><p>Bess</p></comp>');
|
expect(renderToHtml(Template, null)).toEqual('<comp><p>Bess</p></comp>');
|
||||||
|
@ -383,7 +383,7 @@ describe('render3 integration test', () => {
|
||||||
}
|
}
|
||||||
p(0, 'condition', b(ctx.condition));
|
p(0, 'condition', b(ctx.condition));
|
||||||
MyComp.ngComponentDef.h(1, 0);
|
MyComp.ngComponentDef.h(1, 0);
|
||||||
MyComp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(renderToHtml(Template, {condition: true})).toEqual('<comp><div>text</div></comp>');
|
expect(renderToHtml(Template, {condition: true})).toEqual('<comp><div>text</div></comp>');
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', b(ctx.val));
|
p(0, 'val', b(ctx.val));
|
||||||
type.ngComponentDef.h(1, 0);
|
type.ngComponentDef.h(1, 0);
|
||||||
type.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', b(ctx.val));
|
p(0, 'val', b(ctx.val));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {val: '1'});
|
renderToHtml(Template, {val: '1'});
|
||||||
|
@ -90,7 +90,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -116,8 +116,8 @@ describe('lifecycles', () => {
|
||||||
p(2, 'val', 2);
|
p(2, 'val', 2);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.h(3, 2);
|
Parent.ngComponentDef.h(3, 2);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -144,7 +144,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,8 +175,8 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -209,10 +209,10 @@ describe('lifecycles', () => {
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
Comp.ngComponentDef.h(5, 4);
|
Comp.ngComponentDef.h(5, 4);
|
||||||
ProjectedComp.ngComponentDef.h(7, 6);
|
ProjectedComp.ngComponentDef.h(7, 6);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
ProjectedComp.ngComponentDef.r(7, 6);
|
r(7, 6);
|
||||||
Comp.ngComponentDef.r(5, 4);
|
r(5, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -232,7 +232,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -273,13 +273,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', j);
|
p(0, 'val', j);
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Comp.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -319,13 +319,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', j);
|
p(0, 'val', j);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -375,7 +375,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -397,7 +397,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -412,7 +412,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -449,7 +449,7 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(1, 'val', b(ctx.val));
|
p(1, 'val', b(ctx.val));
|
||||||
Comp.ngComponentDef.h(2, 1);
|
Comp.ngComponentDef.h(2, 1);
|
||||||
Comp.ngComponentDef.r(2, 1);
|
r(2, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
let ProjectedComp = createAfterContentInitComp('projected', (ctx: any, cm: boolean) => {
|
let ProjectedComp = createAfterContentInitComp('projected', (ctx: any, cm: boolean) => {
|
||||||
|
@ -487,7 +487,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -516,7 +516,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,7 +546,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -570,7 +570,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -597,8 +597,8 @@ describe('lifecycles', () => {
|
||||||
p(3, 'val', 2);
|
p(3, 'val', 2);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.h(4, 3);
|
Parent.ngComponentDef.h(4, 3);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -628,8 +628,8 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -675,10 +675,10 @@ describe('lifecycles', () => {
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
Parent.ngComponentDef.h(6, 5);
|
Parent.ngComponentDef.h(6, 5);
|
||||||
ProjectedComp.ngComponentDef.h(8, 7);
|
ProjectedComp.ngComponentDef.h(8, 7);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
ProjectedComp.ngComponentDef.r(8, 7);
|
r(8, 7);
|
||||||
Parent.ngComponentDef.r(6, 5);
|
r(6, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -717,13 +717,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', i);
|
p(0, 'val', i);
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Comp.ngComponentDef.r(5, 4);
|
r(5, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -754,13 +754,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', i);
|
p(0, 'val', i);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(5, 4);
|
r(5, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
it('should be called in correct order in a for loop with children', () => {
|
it('should be called in correct order in a for loop with children', () => {
|
||||||
|
@ -788,7 +788,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -854,7 +854,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -882,7 +882,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -912,7 +912,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -938,8 +938,8 @@ describe('lifecycles', () => {
|
||||||
p(2, 'val', 2);
|
p(2, 'val', 2);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.h(3, 2);
|
Parent.ngComponentDef.h(3, 2);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
}
|
}
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
expect(events).toEqual(['comp1', 'comp2', 'parent1', 'parent2']);
|
expect(events).toEqual(['comp1', 'comp2', 'parent1', 'parent2']);
|
||||||
|
@ -963,8 +963,8 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1003,10 +1003,10 @@ describe('lifecycles', () => {
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
Comp.ngComponentDef.h(5, 4);
|
Comp.ngComponentDef.h(5, 4);
|
||||||
ProjectedComp.ngComponentDef.h(7, 6);
|
ProjectedComp.ngComponentDef.h(7, 6);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
ProjectedComp.ngComponentDef.r(7, 6);
|
r(7, 6);
|
||||||
Comp.ngComponentDef.r(5, 4);
|
r(5, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1032,8 +1032,8 @@ describe('lifecycles', () => {
|
||||||
p(2, 'val', b(ctx.val));
|
p(2, 'val', b(ctx.val));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1051,8 +1051,8 @@ describe('lifecycles', () => {
|
||||||
p(2, 'val', 2);
|
p(2, 'val', 2);
|
||||||
ParentComp.ngComponentDef.h(1, 0);
|
ParentComp.ngComponentDef.h(1, 0);
|
||||||
ParentComp.ngComponentDef.h(3, 2);
|
ParentComp.ngComponentDef.h(3, 2);
|
||||||
ParentComp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
ParentComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1088,13 +1088,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', i);
|
p(0, 'val', i);
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Comp.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1131,13 +1131,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', i);
|
p(0, 'val', i);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1157,7 +1157,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1176,7 +1176,7 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', b(ctx.myVal));
|
p(0, 'val', b(ctx.myVal));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {myVal: 5});
|
renderToHtml(Template, {myVal: 5});
|
||||||
|
@ -1215,13 +1215,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', i);
|
p(0, 'val', i);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1284,7 +1284,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1321,8 +1321,8 @@ describe('lifecycles', () => {
|
||||||
p(2, 'val', b('2'));
|
p(2, 'val', b('2'));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.h(3, 2);
|
Comp.ngComponentDef.h(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Comp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1355,7 +1355,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1383,7 +1383,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
function Template(ctx: any, cm: boolean) {
|
function Template(ctx: any, cm: boolean) {
|
||||||
|
@ -1398,7 +1398,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Grandparent.ngComponentDef.h(1, 0);
|
Grandparent.ngComponentDef.h(1, 0);
|
||||||
Grandparent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1452,10 +1452,10 @@ describe('lifecycles', () => {
|
||||||
ProjectedComp.ngComponentDef.h(3, 2);
|
ProjectedComp.ngComponentDef.h(3, 2);
|
||||||
Comp.ngComponentDef.h(5, 4);
|
Comp.ngComponentDef.h(5, 4);
|
||||||
ProjectedComp.ngComponentDef.h(7, 6);
|
ProjectedComp.ngComponentDef.h(7, 6);
|
||||||
ProjectedComp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
ProjectedComp.ngComponentDef.r(7, 6);
|
r(7, 6);
|
||||||
Comp.ngComponentDef.r(5, 4);
|
r(5, 4);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1507,13 +1507,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', b('2'));
|
p(0, 'val', b('2'));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Comp.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1583,13 +1583,13 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', b(j));
|
p(0, 'val', b(j));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cr();
|
cr();
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Comp.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1658,7 +1658,7 @@ describe('lifecycles', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(3, 2);
|
Comp.ngComponentDef.h(3, 2);
|
||||||
Comp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1737,8 +1737,8 @@ describe('lifecycles', () => {
|
||||||
p(2, 'val', 2);
|
p(2, 'val', 2);
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.h(3, 2);
|
Comp.ngComponentDef.h(3, 2);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Comp.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
@ -1767,7 +1767,7 @@ describe('lifecycles', () => {
|
||||||
}
|
}
|
||||||
p(0, 'val', b(ctx.val));
|
p(0, 'val', b(ctx.val));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1785,8 +1785,8 @@ describe('lifecycles', () => {
|
||||||
p(2, 'val', 2);
|
p(2, 'val', 2);
|
||||||
Parent.ngComponentDef.h(1, 0);
|
Parent.ngComponentDef.h(1, 0);
|
||||||
Parent.ngComponentDef.h(3, 2);
|
Parent.ngComponentDef.h(3, 2);
|
||||||
Parent.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
Parent.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderToHtml(Template, {});
|
renderToHtml(Template, {});
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {C, E, L, T, V, cR, cr, defineComponent, e, v} from '../../src/render3/index';
|
import {C, E, L, T, V, cR, cr, defineComponent, e, r, v} from '../../src/render3/index';
|
||||||
|
|
||||||
import {containerEl, renderComponent, renderToHtml} from './render_util';
|
import {containerEl, renderComponent, renderToHtml} from './render_util';
|
||||||
|
|
||||||
|
@ -208,8 +208,8 @@ describe('event listeners', () => {
|
||||||
}
|
}
|
||||||
MyComp.ngComponentDef.h(2, 1);
|
MyComp.ngComponentDef.h(2, 1);
|
||||||
MyComp.ngComponentDef.h(4, 3);
|
MyComp.ngComponentDef.h(4, 3);
|
||||||
MyComp.ngComponentDef.r(2, 1);
|
r(2, 1);
|
||||||
MyComp.ngComponentDef.r(4, 3);
|
r(4, 3);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import {EventEmitter} from '@angular/core';
|
import {EventEmitter} from '@angular/core';
|
||||||
|
|
||||||
import {C, E, L, T, V, b, cR, cr, defineComponent, defineDirective, e, p, v} from '../../src/render3/index';
|
import {C, E, L, T, V, b, cR, cr, defineComponent, defineDirective, e, p, r, v} from '../../src/render3/index';
|
||||||
|
|
||||||
import {containerEl, renderToHtml} from './render_util';
|
import {containerEl, renderToHtml} from './render_util';
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ describe('outputs', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
|
@ -75,7 +75,7 @@ describe('outputs', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
|
@ -99,7 +99,7 @@ describe('outputs', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ctx = {counter: 0};
|
const ctx = {counter: 0};
|
||||||
|
@ -133,7 +133,7 @@ describe('outputs', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ describe('outputs', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,8 +252,8 @@ describe('outputs', () => {
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(3, 2);
|
ButtonToggle.ngComponentDef.h(3, 2);
|
||||||
DestroyComp.ngComponentDef.h(5, 4);
|
DestroyComp.ngComponentDef.h(5, 4);
|
||||||
ButtonToggle.ngComponentDef.r(3, 2);
|
r(3, 2);
|
||||||
DestroyComp.ngComponentDef.r(5, 4);
|
r(5, 4);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,7 +326,7 @@ describe('outputs', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
|
@ -358,7 +358,7 @@ describe('outputs', () => {
|
||||||
}
|
}
|
||||||
p(0, 'change', b(ctx.change));
|
p(0, 'change', b(ctx.change));
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
|
@ -401,7 +401,7 @@ describe('outputs', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
ButtonToggle.ngComponentDef.h(1, 0);
|
ButtonToggle.ngComponentDef.h(1, 0);
|
||||||
ButtonToggle.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
} else {
|
} else {
|
||||||
if (V(1)) {
|
if (V(1)) {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import {EventEmitter} from '@angular/core';
|
import {EventEmitter} from '@angular/core';
|
||||||
|
|
||||||
import {C, E, L, T, V, b, b1, cR, cr, defineComponent, defineDirective, e, m, p, t, v} from '../../src/render3/index';
|
import {C, E, L, T, V, b, b1, cR, cr, defineComponent, defineDirective, e, m, p, r, t, v} from '../../src/render3/index';
|
||||||
import {NO_CHANGE} from '../../src/render3/instructions';
|
import {NO_CHANGE} from '../../src/render3/instructions';
|
||||||
|
|
||||||
import {renderToHtml} from './render_util';
|
import {renderToHtml} from './render_util';
|
||||||
|
@ -157,7 +157,7 @@ describe('elementProperty', () => {
|
||||||
}
|
}
|
||||||
p(0, 'id', b(ctx.id));
|
p(0, 'id', b(ctx.id));
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(renderToHtml(Template, {id: 1})).toEqual(`<comp></comp>`);
|
expect(renderToHtml(Template, {id: 1})).toEqual(`<comp></comp>`);
|
||||||
|
@ -502,7 +502,7 @@ describe('elementProperty', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
Comp.ngComponentDef.h(1, 0);
|
Comp.ngComponentDef.h(1, 0);
|
||||||
Comp.ngComponentDef.r(1, 0);
|
r(1, 0);
|
||||||
v();
|
v();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {AnimationEvent} from '@angular/animations';
|
||||||
import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing';
|
import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing';
|
||||||
|
|
||||||
import {RendererType2, ViewEncapsulation} from '../../src/core';
|
import {RendererType2, ViewEncapsulation} from '../../src/core';
|
||||||
import {E, L, T, b, defineComponent, detectChanges, e, p} from '../../src/render3/index';
|
import {E, L, T, b, defineComponent, detectChanges, e, p, r} from '../../src/render3/index';
|
||||||
import {createRendererType2} from '../../src/view/index';
|
import {createRendererType2} from '../../src/view/index';
|
||||||
|
|
||||||
import {getAnimationRendererFactory2, getRendererFactory2} from './imported_renderer2';
|
import {getAnimationRendererFactory2, getRendererFactory2} from './imported_renderer2';
|
||||||
|
@ -67,7 +67,7 @@ describe('renderer factory lifecycle', () => {
|
||||||
e();
|
e();
|
||||||
}
|
}
|
||||||
SomeComponent.ngComponentDef.h(2, 1);
|
SomeComponent.ngComponentDef.h(2, 1);
|
||||||
SomeComponent.ngComponentDef.r(2, 1);
|
r(2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(() => { logs = []; });
|
beforeEach(() => { logs = []; });
|
||||||
|
|
Loading…
Reference in New Issue