refactor(ivy): use ɵɵ instead of Δ for now (#29850)

The `Δ` caused issue with other infrastructure, and we are temporarily
changing it to `ɵɵ`.

This commit also patches ts_api_guardian_test and AIO to understand `ɵɵ`.

PR Close #29850
This commit is contained in:
Alex Rickabaugh
2019-04-11 13:46:47 -07:00
parent 54058ba3a7
commit b0578061ce
146 changed files with 8037 additions and 8005 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ΔdefineInjectable} from '../../di/interface/defs';
import {ɵɵdefineInjectable} from '../../di/interface/defs';
import {StaticProvider} from '../../di/interface/provider';
import {Optional, SkipSelf} from '../../di/metadata';
import {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';
@ -143,7 +143,7 @@ export interface IterableDifferFactory {
*/
export class IterableDiffers {
/** @nocollapse */
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: 'root',
factory: () => new IterableDiffers([new DefaultIterableDifferFactory()])
});

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Optional, SkipSelf, StaticProvider, ΔdefineInjectable} from '../../di';
import {Optional, SkipSelf, StaticProvider, ɵɵdefineInjectable} from '../../di';
import {DefaultKeyValueDifferFactory} from './default_keyvalue_differ';
@ -118,7 +118,7 @@ export interface KeyValueDifferFactory {
*/
export class KeyValueDiffers {
/** @nocollapse */
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: 'root',
factory: () => new KeyValueDiffers([new DefaultKeyValueDifferFactory()])
});

View File

@ -13,8 +13,8 @@ export {devModeEqual as ɵdevModeEqual} from './change_detection/change_detectio
export {isListLikeIterable as ɵisListLikeIterable} from './change_detection/change_detection_util';
export {ChangeDetectorStatus as ɵChangeDetectorStatus, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy} from './change_detection/constants';
export {Console as ɵConsole} from './console';
export {inject, setCurrentInjector as ɵsetCurrentInjector, Δinject} from './di/injector_compatibility';
export {getInjectableDef as ɵgetInjectableDef, ΔInjectableDef as ΔInjectableDef, ΔInjectorDef} from './di/interface/defs';
export {inject, setCurrentInjector as ɵsetCurrentInjector, ɵɵinject} from './di/injector_compatibility';
export {getInjectableDef as ɵgetInjectableDef, ɵɵInjectableDef as ɵɵInjectableDef, ɵɵInjectorDef} from './di/interface/defs';
export {APP_ROOT as ɵAPP_ROOT} from './di/scope';
export {ivyEnabled as ɵivyEnabled} from './ivy_switch';
export {ComponentFactory as ɵComponentFactory} from './linker/component_factory';

View File

@ -8,11 +8,11 @@
// clang-format off
export {
ΔdefineBase,
ΔdefineComponent,
ΔdefineDirective,
ΔdefinePipe,
ΔdefineNgModule,
ɵɵdefineBase,
ɵɵdefineComponent,
ɵɵdefineDirective,
ɵɵdefinePipe,
ɵɵdefineNgModule,
detectChanges as ɵdetectChanges,
renderComponent as ɵrenderComponent,
AttributeMarker as ɵAttributeMarker,
@ -21,16 +21,16 @@ export {
ComponentRef as ɵRender3ComponentRef,
DirectiveType as ɵDirectiveType,
RenderFlags as ɵRenderFlags,
ΔdirectiveInject,
ΔinjectAttribute,
ΔgetFactoryOf,
ΔgetInheritedFactory,
ΔsetComponentScope,
ΔsetNgModuleScope,
ΔtemplateRefExtractor,
ΔProvidersFeature,
ΔInheritDefinitionFeature,
ΔNgOnChangesFeature,
ɵɵdirectiveInject,
ɵɵinjectAttribute,
ɵɵgetFactoryOf,
ɵɵgetInheritedFactory,
ɵɵsetComponentScope,
ɵɵsetNgModuleScope,
ɵɵtemplateRefExtractor,
ɵɵProvidersFeature,
ɵɵInheritDefinitionFeature,
ɵɵNgOnChangesFeature,
LifecycleHooksFeature as ɵLifecycleHooksFeature,
NgModuleType as ɵNgModuleType,
NgModuleRef as ɵRender3NgModuleRef,
@ -38,108 +38,108 @@ export {
markDirty as ɵmarkDirty,
NgModuleFactory as ɵNgModuleFactory,
NO_CHANGE as ɵNO_CHANGE,
Δcontainer,
ΔnextContext,
ΔelementStart,
ΔnamespaceHTML,
ΔnamespaceMathML,
ΔnamespaceSVG,
Δelement,
Δlistener,
Δtext,
ΔembeddedViewStart,
Δprojection,
Δbind,
Δinterpolation1,
Δinterpolation2,
Δinterpolation3,
Δinterpolation4,
Δinterpolation5,
Δinterpolation6,
Δinterpolation7,
Δinterpolation8,
ΔinterpolationV,
ΔpipeBind1,
ΔpipeBind2,
ΔpipeBind3,
ΔpipeBind4,
ΔpipeBindV,
ΔpureFunction0,
ΔpureFunction1,
ΔpureFunction2,
ΔpureFunction3,
ΔpureFunction4,
ΔpureFunction5,
ΔpureFunction6,
ΔpureFunction7,
ΔpureFunction8,
ΔpureFunctionV,
ΔgetCurrentView,
ɵɵcontainer,
ɵɵnextContext,
ɵɵelementStart,
ɵɵnamespaceHTML,
ɵɵnamespaceMathML,
ɵɵnamespaceSVG,
ɵɵelement,
ɵɵlistener,
ɵɵtext,
ɵɵembeddedViewStart,
ɵɵprojection,
ɵɵbind,
ɵɵinterpolation1,
ɵɵinterpolation2,
ɵɵinterpolation3,
ɵɵinterpolation4,
ɵɵinterpolation5,
ɵɵinterpolation6,
ɵɵinterpolation7,
ɵɵinterpolation8,
ɵɵinterpolationV,
ɵɵpipeBind1,
ɵɵpipeBind2,
ɵɵpipeBind3,
ɵɵpipeBind4,
ɵɵpipeBindV,
ɵɵpureFunction0,
ɵɵpureFunction1,
ɵɵpureFunction2,
ɵɵpureFunction3,
ɵɵpureFunction4,
ɵɵpureFunction5,
ɵɵpureFunction6,
ɵɵpureFunction7,
ɵɵpureFunction8,
ɵɵpureFunctionV,
ɵɵgetCurrentView,
getDirectives as ɵgetDirectives,
getHostElement as ɵgetHostElement,
ΔrestoreView,
ΔcontainerRefreshStart,
ΔcontainerRefreshEnd,
ΔqueryRefresh,
ΔviewQuery,
ΔstaticViewQuery,
ΔstaticContentQuery,
ΔloadViewQuery,
ΔcontentQuery,
ΔloadContentQuery,
ΔelementEnd,
ΔelementProperty,
ΔcomponentHostSyntheticProperty,
ΔcomponentHostSyntheticListener,
ΔprojectionDef,
Δreference,
ΔenableBindings,
ΔdisableBindings,
ΔallocHostVars,
ΔelementAttribute,
ΔelementContainerStart,
ΔelementContainerEnd,
ΔelementStyling,
ΔelementStylingMap,
ΔelementStyleProp,
ΔelementStylingApply,
ΔelementClassProp,
ɵɵrestoreView,
ɵɵcontainerRefreshStart,
ɵɵcontainerRefreshEnd,
ɵɵqueryRefresh,
ɵɵviewQuery,
ɵɵstaticViewQuery,
ɵɵstaticContentQuery,
ɵɵloadViewQuery,
ɵɵcontentQuery,
ɵɵloadContentQuery,
ɵɵelementEnd,
ɵɵelementProperty,
ɵɵcomponentHostSyntheticProperty,
ɵɵcomponentHostSyntheticListener,
ɵɵprojectionDef,
ɵɵreference,
ɵɵenableBindings,
ɵɵdisableBindings,
ɵɵallocHostVars,
ɵɵelementAttribute,
ɵɵelementContainerStart,
ɵɵelementContainerEnd,
ɵɵelementStyling,
ɵɵelementStylingMap,
ɵɵelementStyleProp,
ɵɵelementStylingApply,
ɵɵelementClassProp,
ΔelementHostAttrs,
ΔelementHostStyling,
ΔelementHostStylingMap,
ΔelementHostStyleProp,
ΔelementHostClassProp,
ΔelementHostStylingApply,
ɵɵelementHostAttrs,
ɵɵelementHostStyling,
ɵɵelementHostStylingMap,
ɵɵelementHostStyleProp,
ɵɵelementHostClassProp,
ɵɵelementHostStylingApply,
Δselect,
ΔtextBinding,
Δtemplate,
ΔembeddedViewEnd,
ɵɵselect,
ɵɵtextBinding,
ɵɵtemplate,
ɵɵembeddedViewEnd,
store as ɵstore,
Δload,
Δpipe,
ΔBaseDef,
ɵɵload,
ɵɵpipe,
ɵɵBaseDef,
ComponentDef as ɵComponentDef,
ΔComponentDefWithMeta,
ɵɵComponentDefWithMeta,
DirectiveDef as ɵDirectiveDef,
ΔDirectiveDefWithMeta,
ɵɵDirectiveDefWithMeta,
PipeDef as ɵPipeDef,
ΔPipeDefWithMeta,
ɵɵPipeDefWithMeta,
whenRendered as ɵwhenRendered,
Δi18n,
Δi18nAttributes,
Δi18nExp,
Δi18nStart,
Δi18nEnd,
Δi18nApply,
Δi18nPostprocess,
ɵɵi18n,
ɵɵi18nAttributes,
ɵɵi18nExp,
ɵɵi18nStart,
ɵɵi18nEnd,
ɵɵi18nApply,
ɵɵi18nPostprocess,
i18nConfigureLocalize as ɵi18nConfigureLocalize,
Δi18nLocalize,
ɵɵi18nLocalize,
setClassMetadata as ɵsetClassMetadata,
ΔresolveWindow,
ΔresolveDocument,
ΔresolveBody,
ɵɵresolveWindow,
ɵɵresolveDocument,
ɵɵresolveBody,
} from './render3/index';
@ -161,18 +161,18 @@ export {
export {
NgModuleDef as ɵNgModuleDef,
ΔNgModuleDefWithMeta,
ɵɵNgModuleDefWithMeta,
NgModuleTransitiveScopes as ɵNgModuleTransitiveScopes,
} from './metadata/ng_module';
export {
ΔsanitizeHtml,
ΔsanitizeStyle,
ΔdefaultStyleSanitizer,
ΔsanitizeScript,
ΔsanitizeUrl,
ΔsanitizeResourceUrl,
ΔsanitizeUrlOrResourceUrl,
ɵɵsanitizeHtml,
ɵɵsanitizeStyle,
ɵɵdefaultStyleSanitizer,
ɵɵsanitizeScript,
ɵɵsanitizeUrl,
ɵɵsanitizeResourceUrl,
ɵɵsanitizeUrlOrResourceUrl,
} from './sanitization/sanitization';
export {

View File

@ -14,11 +14,11 @@
export * from './metadata';
export {InjectFlags} from './interface/injector';
export {ΔdefineInjectable, defineInjectable, ΔdefineInjector, InjectableType, InjectorType} from './interface/defs';
export {ɵɵdefineInjectable, defineInjectable, ɵɵdefineInjector, InjectableType, InjectorType} from './interface/defs';
export {forwardRef, resolveForwardRef, ForwardRefFn} from './forward_ref';
export {Injectable, InjectableDecorator, InjectableProvider} from './injectable';
export {INJECTOR, Injector} from './injector';
export {Δinject, inject} from './injector_compatibility';
export {ɵɵinject, inject} from './injector_compatibility';
export {ReflectiveInjector} from './reflective_injector';
export {StaticProvider, ValueProvider, ConstructorSansProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider} from './interface/provider';
export {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './reflective_provider';

View File

@ -9,7 +9,7 @@
import {Type} from '../interface/type';
import {TypeDecorator, makeDecorator} from '../util/decorators';
import {InjectableType, getInjectableDef, ΔInjectableDef, ΔdefineInjectable} from './interface/defs';
import {InjectableType, getInjectableDef, ɵɵInjectableDef, ɵɵdefineInjectable} from './interface/defs';
import {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueSansProvider} from './interface/provider';
import {compileInjectable as render3CompileInjectable} from './jit/injectable';
import {convertInjectableProviderToFactory} from './util';
@ -80,7 +80,7 @@ export const Injectable: InjectableDecorator = makeDecorator(
*
* @publicApi
*/
export interface InjectableType<T> extends Type<T> { ngInjectableDef: ΔInjectableDef<T>; }
export interface InjectableType<T> extends Type<T> { ngInjectableDef: ɵɵInjectableDef<T>; }
/**
* Supports @Injectable() in JIT mode for Render2.
@ -89,7 +89,7 @@ function render2CompileInjectable(
injectableType: InjectableType<any>,
options: {providedIn?: Type<any>| 'root' | null} & InjectableProvider): void {
if (options && options.providedIn !== undefined && !getInjectableDef(injectableType)) {
injectableType.ngInjectableDef = ΔdefineInjectable({
injectableType.ngInjectableDef = ɵɵdefineInjectable({
providedIn: options.providedIn,
factory: convertInjectableProviderToFactory(injectableType, options),
});

View File

@ -8,7 +8,7 @@
import {Type} from '../interface/type';
import {ΔdefineInjectable} from './interface/defs';
import {ɵɵdefineInjectable} from './interface/defs';
/**
* Creates a token that can be used in a DI Provider.
@ -67,7 +67,7 @@ export class InjectionToken<T> {
// We are using it to assign `-1` which is used to identify `Injector`.
(this as any).__NG_ELEMENT_ID__ = options;
} else if (options !== undefined) {
this.ngInjectableDef = ΔdefineInjectable({
this.ngInjectableDef = ɵɵdefineInjectable({
providedIn: options.providedIn || 'root',
factory: options.factory,
});

View File

@ -11,8 +11,8 @@ import {getClosureSafeProperty} from '../util/property';
import {stringify} from '../util/stringify';
import {resolveForwardRef} from './forward_ref';
import {InjectionToken} from './injection_token';
import {Δinject} from './injector_compatibility';
import {ΔdefineInjectable} from './interface/defs';
import {ɵɵinject} from './injector_compatibility';
import {ɵɵdefineInjectable} from './interface/defs';
import {InjectFlags} from './interface/injector';
import {ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, StaticProvider, ValueProvider} from './interface/provider';
import {Inject, Optional, Self, SkipSelf} from './metadata';
@ -107,9 +107,9 @@ export abstract class Injector {
}
/** @nocollapse */
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: 'any' as any,
factory: () => Δinject(INJECTOR),
factory: () => ɵɵinject(INJECTOR),
});
/**

View File

@ -11,7 +11,7 @@ import {stringify} from '../util/stringify';
import {InjectionToken} from './injection_token';
import {Injector} from './injector';
import {getInjectableDef, ΔInjectableDef} from './interface/defs';
import {getInjectableDef, ɵɵInjectableDef} from './interface/defs';
import {InjectFlags} from './interface/injector';
import {Inject, Optional, Self, SkipSelf} from './metadata';
@ -97,17 +97,18 @@ export function injectInjectorOnly<T>(
*
* @publicApi
*/
export function Δinject<T>(token: Type<T>| InjectionToken<T>): T;
export function Δinject<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags): T|null;
export function Δinject<T>(token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {
export function ɵɵinject<T>(token: Type<T>| InjectionToken<T>): T;
export function ɵɵinject<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags): T|null;
export function ɵɵinject<T>(token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|
null {
return (_injectImplementation || injectInjectorOnly)(token, flags);
}
/**
* @deprecated in v8, delete after v10. This API should be used only be generated code, and that
* code should now use Δinject instead.
* code should now use ɵɵinject instead.
* @publicApi
*/
export const inject = Δinject;
export const inject = ɵɵinject;
/**
* Injects `root` tokens in limp mode.
@ -118,7 +119,7 @@ export const inject = Δinject;
*/
export function injectRootLimpMode<T>(
token: Type<T>| InjectionToken<T>, notFoundValue: T | undefined, flags: InjectFlags): T|null {
const injectableDef: ΔInjectableDef<T>|null = getInjectableDef(token);
const injectableDef: ɵɵInjectableDef<T>|null = getInjectableDef(token);
if (injectableDef && injectableDef.providedIn == 'root') {
return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :
injectableDef.value;
@ -154,9 +155,9 @@ export function injectArgs(types: (Type<any>| InjectionToken<any>| any[])[]): an
}
}
args.push(Δinject(type !, flags));
args.push(ɵɵinject(type !, flags));
} else {
args.push(Δinject(arg));
args.push(ɵɵinject(arg));
}
}
return args;

View File

@ -26,7 +26,7 @@ import {ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, S
*
* @publicApi
*/
export interface ΔInjectableDef<T> {
export interface ɵɵInjectableDef<T> {
/**
* Specifies that the given type belongs to a particular injector:
* - `InjectorType` such as `NgModule`,
@ -60,7 +60,7 @@ export interface ΔInjectableDef<T> {
*
* @publicApi
*/
export interface ΔInjectorDef<T> {
export interface ɵɵInjectorDef<T> {
factory: () => T;
// TODO(alxhub): Narrow down the type here once decorators properly change the return type of the
@ -131,21 +131,21 @@ export interface InjectorTypeWithProviders<T> {
*
* @publicApi
*/
export function ΔdefineInjectable<T>(opts: {
export function ɵɵdefineInjectable<T>(opts: {
providedIn?: Type<any>| 'root' | 'any' | null,
factory: () => T,
}): never {
return ({
providedIn: opts.providedIn as any || null, factory: opts.factory, value: undefined,
} as ΔInjectableDef<T>) as never;
} as ɵɵInjectableDef<T>) as never;
}
/**
* @deprecated in v8, delete after v10. This API should be used only be generated code, and that
* code should now use ΔdefineInjectable instead.
* code should now use ɵɵdefineInjectable instead.
* @publicApi
*/
export const defineInjectable = ΔdefineInjectable;
export const defineInjectable = ɵɵdefineInjectable;
/**
* Construct an `InjectorDef` which configures an injector.
@ -167,11 +167,11 @@ export const defineInjectable = ΔdefineInjectable;
*
* @publicApi
*/
export function ΔdefineInjector(options: {factory: () => any, providers?: any[], imports?: any[]}):
export function ɵɵdefineInjector(options: {factory: () => any, providers?: any[], imports?: any[]}):
never {
return ({
factory: options.factory, providers: options.providers || [], imports: options.imports || [],
} as ΔInjectorDef<any>) as never;
} as ɵɵInjectorDef<any>) as never;
}
/**
@ -179,7 +179,7 @@ export function ΔdefineInjector(options: {factory: () => any, providers?: any[]
*
* @param type type which may have `ngInjectableDef`
*/
export function getInjectableDef<T>(type: any): ΔInjectableDef<T>|null {
export function getInjectableDef<T>(type: any): ɵɵInjectableDef<T>|null {
return type && type.hasOwnProperty(NG_INJECTABLE_DEF) ? (type as any)[NG_INJECTABLE_DEF] : null;
}
@ -188,7 +188,7 @@ export function getInjectableDef<T>(type: any): ΔInjectableDef<T>|null {
*
* @param type type which may have `ngInjectorDef`
*/
export function getInjectorDef<T>(type: any): ΔInjectorDef<T>|null {
export function getInjectorDef<T>(type: any): ɵɵInjectorDef<T>|null {
return type && type.hasOwnProperty(NG_INJECTOR_DEF) ? (type as any)[NG_INJECTOR_DEF] : null;
}

View File

@ -7,8 +7,8 @@
*/
import {Type} from '../../interface/type';
import {Δinject} from '../injector_compatibility';
import {getInjectableDef, getInjectorDef, ΔdefineInjectable, ΔdefineInjector} from '../interface/defs';
import {ɵɵinject} from '../injector_compatibility';
import {getInjectableDef, getInjectorDef, ɵɵdefineInjectable, ɵɵdefineInjector} from '../interface/defs';
@ -18,10 +18,10 @@ import {getInjectableDef, getInjectorDef, ΔdefineInjectable, ΔdefineInjector}
* This should be kept up to date with the public exports of @angular/core.
*/
export const angularCoreDiEnv: {[name: string]: Function} = {
'ΔdefineInjectable': ΔdefineInjectable,
'ΔdefineInjector': ΔdefineInjector,
'Δinject': Δinject,
'ΔgetFactoryOf': getFactoryOf,
'ɵɵdefineInjectable': ɵɵdefineInjectable,
'ɵɵdefineInjector': ɵɵdefineInjector,
'ɵɵinject': ɵɵinject,
'ɵɵgetFactoryOf': getFactoryOf,
};
function getFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)|null {

View File

@ -13,8 +13,8 @@ import {stringify} from '../util/stringify';
import {resolveForwardRef} from './forward_ref';
import {InjectionToken} from './injection_token';
import {INJECTOR, Injector, NG_TEMP_TOKEN_PATH, NullInjector, USE_VALUE, catchInjectorError} from './injector';
import {injectArgs, setCurrentInjector, Δinject} from './injector_compatibility';
import {InjectableType, InjectorType, InjectorTypeWithProviders, getInjectableDef, getInjectorDef, ΔInjectableDef} from './interface/defs';
import {injectArgs, setCurrentInjector, ɵɵinject} from './injector_compatibility';
import {InjectableType, InjectorType, InjectorTypeWithProviders, getInjectableDef, getInjectorDef, ɵɵInjectableDef} from './interface/defs';
import {InjectFlags} from './interface/injector';
import {ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, StaticProvider, TypeProvider, ValueProvider} from './interface/provider';
import {APP_ROOT} from './scope';
@ -356,7 +356,7 @@ export class R3Injector {
return record.value as T;
}
private injectableDefInScope(def: ΔInjectableDef<any>): boolean {
private injectableDefInScope(def: ɵɵInjectableDef<any>): boolean {
if (!def.providedIn) {
return false;
} else if (typeof def.providedIn === 'string') {
@ -413,7 +413,7 @@ export function providerToFactory(
if (isValueProvider(provider)) {
factory = () => resolveForwardRef(provider.useValue);
} else if (isExistingProvider(provider)) {
factory = () => Δinject(resolveForwardRef(provider.useExisting));
factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));
} else if (isFactoryProvider(provider)) {
factory = () => provider.useFactory(...injectArgs(provider.deps || []));
} else {

View File

@ -10,7 +10,7 @@ import {Type} from '../interface/type';
import {ReflectionCapabilities} from '../reflection/reflection_capabilities';
import {getClosureSafeProperty} from '../util/property';
import {injectArgs, Δinject} from './injector_compatibility';
import {injectArgs, ɵɵinject} from './injector_compatibility';
import {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './interface/provider';
const USE_VALUE =
@ -32,7 +32,7 @@ export function convertInjectableProviderToFactory(
return () => valueProvider.useValue;
} else if ((provider as ExistingSansProvider).useExisting) {
const existingProvider = (provider as ExistingSansProvider);
return () => Δinject(existingProvider.useExisting);
return () => ɵɵinject(existingProvider.useExisting);
} else if ((provider as FactorySansProvider).useFactory) {
const factoryProvider = (provider as FactorySansProvider);
return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY));

View File

@ -7,7 +7,7 @@
*/
import {ApplicationRef} from '../application_ref';
import {InjectorType, ΔdefineInjector} from '../di/interface/defs';
import {InjectorType, ɵɵdefineInjector} from '../di/interface/defs';
import {Provider} from '../di/interface/provider';
import {convertInjectableProviderToFactory} from '../di/util';
import {Type} from '../interface/type';
@ -35,7 +35,7 @@ export interface NgModuleTransitiveScopes {
/**
* @publicApi
*/
export type ΔNgModuleDefWithMeta<T, Declarations, Imports, Exports> = NgModuleDef<T>;
export type ɵɵNgModuleDefWithMeta<T, Declarations, Imports, Exports> = NgModuleDef<T>;
/**
* Runtime link information for NgModules.
@ -43,7 +43,7 @@ export type ΔNgModuleDefWithMeta<T, Declarations, Imports, Exports> = NgModuleD
* This is the internal data structure used by the runtime to assemble components, directives,
* pipes, and injectors.
*
* NOTE: Always use `ΔdefineNgModule` function to create this object,
* NOTE: Always use `ɵɵdefineNgModule` function to create this object,
* never create the object directly since the shape of this object
* can change between versions.
*/
@ -347,7 +347,7 @@ function preR3NgModuleCompile(moduleType: InjectorType<any>, metadata: NgModule)
imports = [...imports, metadata.exports];
}
moduleType.ngInjectorDef = ΔdefineInjector({
moduleType.ngInjectorDef = ɵɵdefineInjector({
factory: convertInjectableProviderToFactory(moduleType, {useClass: moduleType}),
providers: metadata && metadata.providers,
imports: imports,

View File

@ -21,10 +21,10 @@
* The below symbols are used for @Injectable and @NgModule compilation.
*/
export {Δinject} from './di/injector_compatibility';
export {ΔInjectableDef, ΔInjectorDef, ΔdefineInjectable, ΔdefineInjector} from './di/interface/defs';
export {NgModuleDef, ΔNgModuleDefWithMeta} from './metadata/ng_module';
export {ΔdefineNgModule} from './render3/definition';
export {ɵɵinject} from './di/injector_compatibility';
export {ɵɵInjectableDef, ɵɵInjectorDef, ɵɵdefineInjectable, ɵɵdefineInjector} from './di/interface/defs';
export {NgModuleDef, ɵɵNgModuleDefWithMeta} from './metadata/ng_module';
export {ɵɵdefineNgModule} from './render3/definition';
export {setClassMetadata} from './render3/metadata';
export {NgModuleFactory} from './render3/ng_module_ref';

View File

@ -0,0 +1,11 @@
# Code Gen API
### Prefix ɵɵ
Ivy exports a number of functions prefixed with `ɵɵ`, for example `ɵɵelementStart`, or `ɵɵinject`, et al. These functions are part of API required for code generation by the Angular compiler. These functions are called by generated code, and they must be publicly exposed in order to be consumed by this generated code. **They are not meant for developer consumption**. The reason they are prefixed with `ɵɵ` is not only to identify them as different from other functions, but also to make them not show up at the top of IDE code completion in environments such as Visual Studio code.
### Guidance
- Do not use `ɵɵ` functions directly. They are meant to be used in generated code.
- Do not create new `ɵɵ` functions, it's not a convention that Angular consumes, and it is liable to confuse other developers into thinking consuming Angular's `ɵɵ` functions is a good pattern to follow.

View File

@ -1,9 +0,0 @@
# Delta Instructions
Ivy exports a number of functions prefixed with `Δ`, for example `ΔelementStart`, or `Δinject`, et al. These functions are referred to an "instructions" or "delta" instructions. They are functions that are called by code generated by the Ivy compiler that must be publicly exposed in order to be consumed by this generated code. **They are not meant for developer consumption**. The reason they are prefixed with `Δ` is not only to identify them as different from other functions, but also to make them not show up at the top of IDE code completion in environments such as Visual Studio code.
### Guidance
- Do not use `Δ` functions directly. They are meant to be used in generated code.
- Do not create new `Δ` functions, it's not a convention that Angular consumes, and it is liable to confuse other developers into thinking consuming Angular's `Δ` functions is a good pattern to follow.

View File

@ -10,8 +10,8 @@ We currently expect Ivy to remain behind the flag until it's feature complete an
The work can be divided into three categories:
- `@angular/compiler-cli`: TypeScript transformer pipeline which includes two command line tools:
- `ngtsc`: (Angular TypeScript Compiler) Angular compiler which strips out `@Component` (and friends) and replaces it with `ΔdefineComponent` (and friends).
- `ngcc`: (Angular Compatibility Compiler) NPM upgrade compiler which reads the `STORING_METADATA_IN_D.TS.json` files and `.js` files and adds `ΔdefineComponent` (and friends) into the `node_module`. This in effect converts a pre-ivy module into ivy module.
- `ngtsc`: (Angular TypeScript Compiler) Angular compiler which strips out `@Component` (and friends) and replaces it with `ɵɵdefineComponent` (and friends).
- `ngcc`: (Angular Compatibility Compiler) NPM upgrade compiler which reads the `STORING_METADATA_IN_D.TS.json` files and `.js` files and adds `ɵɵdefineComponent` (and friends) into the `node_module`. This in effect converts a pre-ivy module into ivy module.
- `@angular/compiler`: Ivy Compiler which converts decorator into ivy
- `@angular/core`: Decorators which can be patched with `@angular/compiler`.
@ -20,7 +20,7 @@ The work can be divided into three categories:
### `ngtsc` TSC compiler transformer
TSC transformer which removes and converts `@Pipe`, `@Component`, `@Directive` and `@NgModule`
to the corresponding `ΔdefinePipe`, `ΔdefineComponent`, `ΔdefineDirective` and `ΔdefineInjector`.
to the corresponding `ɵɵdefinePipe`, `ɵɵdefineComponent`, `ɵɵdefineDirective` and `ɵɵdefineInjector`.
- ✅ Basic setup of the transformer into `tsc`
- ✅ Can read STORING_METADATA_IN_D.TS from `.d.ts` (see: [STORING_METADATA_IN_D.TS.md](./STORING_METADATA_IN_D.TS.md))
@ -40,19 +40,19 @@ A tool which "upgrades" `node_module` compiled with non-ivy `ngc` into ivy compl
## `@angular/compiler` changes
- ✅ Component compilation: Translates `@Component` => `ΔdefineComponent`
- ✅ Component compilation: Translates `@Component` => `ɵɵdefineComponent`
-`TemplateCompiler` (current known as `ViewCompiler`)
-`StyleCompiler`
-`PipeCompiler`: Translates `@Pipe` => `ΔdefinePipe`
-`DirectiveCompiler`: Translates `@Directive` => `ΔdefineDirective`
-`InjectableCompiler`: Translates `@Injectable` => `ΔdefineInjectable`
-`NgModuleCompiler`: Translates `@NgModule` => `ΔdefineInjector` (and `ΔdefineNgModule` only in jit)
-`PipeCompiler`: Translates `@Pipe` => `ɵɵdefinePipe`
-`DirectiveCompiler`: Translates `@Directive` => `ɵɵdefineDirective`
-`InjectableCompiler`: Translates `@Injectable` => `ɵɵdefineInjectable`
-`NgModuleCompiler`: Translates `@NgModule` => `ɵɵdefineInjector` (and `ɵɵdefineNgModule` only in jit)
- ❌ Documentation
## `@angular/core` changes
The goal is for the `@Component` (and friends) to be the compiler of template. Since decorators are functions which execute during parsing of the `.js` file, the decorator can compile the template into Ivy. The AoT compiler's job is to remove the `@Component` and replace it with call to `ΔdefineComponent`.
The goal is for the `@Component` (and friends) to be the compiler of template. Since decorators are functions which execute during parsing of the `.js` file, the decorator can compile the template into Ivy. The AoT compiler's job is to remove the `@Component` and replace it with call to `ɵɵdefineComponent`.
-`@angular/compiler` can patch itself onto:
-`@Injectable`
@ -70,13 +70,13 @@ The goal is for the `@Component` (and friends) to be the compiler of template. S
## Decorators
| Annotation | `defineXXX()` | Run time | Spec | Compiler |
| -------------------- | ------------------------------ | ------- | -------- | -------- |
| `@Component` | ✅ `ΔdefineComponent()` | ✅ | ✅ | ✅ |
| `@Directive` | ✅ `ΔdefineDirective()` | ✅ | ✅ | ✅ |
| `@Directive` | ✅ `ΔdefineBase()` | ✅ | ✅ | ✅ |
| `@Pipe` | ✅ `ΔdefinePipe()` | ✅ | ✅ | ✅ |
| `@Injectable` | ✅ `ΔdefineInjectable()` | ✅ | ✅ | ✅ |
| `@NgModule` | ✅ `ΔdefineInjector()` | ✅ | ✅ | ✅ |
| `@ConfigureInjector` | ✅ `ΔdefineInjector()` | ❌ | ❌ | ❌ |
| `@Component` | ✅ `ɵɵdefineComponent()` | ✅ | ✅ | ✅ |
| `@Directive` | ✅ `ɵɵdefineDirective()` | ✅ | ✅ | ✅ |
| `@Directive` | ✅ `ɵɵdefineBase()` | ✅ | ✅ | ✅ |
| `@Pipe` | ✅ `ɵɵdefinePipe()` | ✅ | ✅ | ✅ |
| `@Injectable` | ✅ `ɵɵdefineInjectable()` | ✅ | ✅ | ✅ |
| `@NgModule` | ✅ `ɵɵdefineInjector()` | ✅ | ✅ | ✅ |
| `@ConfigureInjector` | ✅ `ɵɵdefineInjector()` | ❌ | ❌ | ❌ |

View File

@ -13,7 +13,7 @@ Here is an abbreviated example of breakage of tree-shake-ability.
})
export class TooltipDirective {
// ngtsc generates this:
static ngDirectiveDef = ΔdefineDirective(...);
static ngDirectiveDef = ɵɵdefineDirective(...);
}
@Component({
@ -22,7 +22,7 @@ export class TooltipDirective {
})
class MyAppComponent {
// ngtsc generates this:
static ngDirectiveDef = ΔdefineComponent({
static ngDirectiveDef = ɵɵdefineComponent({
...
directives: [
// BREAKS TREE-SHAKING!!!
@ -41,7 +41,7 @@ class MyAppComponent {
})
class MyAppModule {
// ngtsc generates this:
static ngDirectiveDef = ΔdefineNgModule(...);
static ngDirectiveDef = ɵɵdefineNgModule(...);
}
```

View File

@ -36,18 +36,18 @@ The size of the `CONSTS` section is declared in the property `consts` of the com
})
class MyApp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
...,
consts: 5,
template: function(rf: RenderFlags, ctx: MyApp) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δtext(1, 'Hello ');
ΔelementStart(2, 'b');
Δtext(3, 'World');
ΔelementEnd();
Δtext(4, '!');
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵtext(1, 'Hello ');
ɵɵelementStart(2, 'b');
ɵɵtext(3, 'World');
ɵɵelementEnd();
ɵɵtext(4, '!');
ɵɵelementEnd();
}
...
}
@ -87,19 +87,19 @@ The size of the `VARS `section is declared in the property `vars` of the compone
class MyApp {
name = 'World';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
...,
consts: 2, // Two DOM Elements.
vars: 2, // Two bindings.
template: function(rf: RenderFlags, ctx: MyApp) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δtext(1);
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵtext(1);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'title', Δbind(ctx.name));
ΔtextBinding(1, Δinterpolation1('Hello ', ctx.name, '!'));
ɵɵelementProperty(0, 'title', ɵɵbind(ctx.name));
ɵɵtextBinding(1, ɵɵinterpolation1('Hello ', ctx.name, '!'));
}
...
}
@ -139,12 +139,12 @@ Examples include:
})
class MyApp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
...,
consts: 1,
template: function(rf: RenderFlags, ctx: MyApp) {
if (rf & RenderFlags.Create) {
Δelement(0, 'child', ['tooltip', null]);
ɵɵelement(0, 'child', ['tooltip', null]);
}
...
},
@ -159,7 +159,7 @@ class MyApp {
})
class Child {
@HostBinding('tooltip') hostTitle = 'Hello World!';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
...
hostVars: 1
});
@ -171,7 +171,7 @@ class Child {
})
class Tooltip {
@HostBinding('title') hostTitle = 'greeting';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
...
hostVars: 1
});
@ -273,12 +273,12 @@ Injection tokens are sorted into three sections:
})
class MyApp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
...,
consts: 1,
template: function(rf: RenderFlags, ctx: MyApp) {
if (rf & RenderFlags.Create) {
Δelement(0, 'child');
ɵɵelement(0, 'child');
}
...
},
@ -301,7 +301,7 @@ class MyApp {
})
class Child {
construction(injector: Injector) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
...
features: [
ProvidesFeature(

View File

@ -9,7 +9,7 @@
import {ChangeDetectorRef as ViewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';
import {InjectionToken} from '../di/injection_token';
import {Injector} from '../di/injector';
import {Δinject} from '../di/injector_compatibility';
import {ɵɵinject} from '../di/injector_compatibility';
import {InjectFlags} from '../di/interface/injector';
import {Type} from '../interface/type';
import {ComponentFactory as viewEngine_ComponentFactory, ComponentRef as viewEngine_ComponentRef} from '../linker/component_factory';
@ -66,7 +66,7 @@ function toRefArray(map: {[key: string]: string}): {propName: string; templateNa
*/
export const ROOT_CONTEXT = new InjectionToken<RootContext>(
'ROOT_CONTEXT_TOKEN',
{providedIn: 'root', factory: () => createRootContext(Δinject(SCHEDULER))});
{providedIn: 'root', factory: () => createRootContext(ɵɵinject(SCHEDULER))});
/**
* A change detection scheduler token for {@link RootContext}. This token is the default value used

View File

@ -18,7 +18,7 @@ import {stringify} from '../util/stringify';
import {EMPTY_ARRAY, EMPTY_OBJ} from './empty';
import {NG_COMPONENT_DEF, NG_DIRECTIVE_DEF, NG_MODULE_DEF, NG_PIPE_DEF} from './fields';
import {ComponentDef, ComponentDefFeature, ComponentTemplate, ComponentType, ContentQueriesFunction, DirectiveDef, DirectiveDefFeature, DirectiveType, DirectiveTypesOrFactory, FactoryFn, HostBindingsFunction, PipeDef, PipeType, PipeTypesOrFactory, ViewQueriesFunction, ΔBaseDef} from './interfaces/definition';
import {ComponentDef, ComponentDefFeature, ComponentTemplate, ComponentType, ContentQueriesFunction, DirectiveDef, DirectiveDefFeature, DirectiveType, DirectiveTypesOrFactory, FactoryFn, HostBindingsFunction, PipeDef, PipeType, PipeTypesOrFactory, ViewQueriesFunction, ɵɵBaseDef} from './interfaces/definition';
// while SelectorFlags is unused here, it's required so that types don't get resolved lazily
// see: https://github.com/Microsoft/web-build-tools/issues/1050
import {CssSelectorList, SelectorFlags} from './interfaces/projection';
@ -41,7 +41,7 @@ let _renderCompCount = 0;
* ```
* @codeGenApi
*/
export function ΔdefineComponent<T>(componentDefinition: {
export function ɵɵdefineComponent<T>(componentDefinition: {
/**
* Directive type, needed to configure the injector.
*/
@ -307,7 +307,7 @@ export function ΔdefineComponent<T>(componentDefinition: {
/**
* @codeGenApi
*/
export function ΔsetComponentScope(
export function ɵɵsetComponentScope(
type: ComponentType<any>, directives: Type<any>[], pipes: Type<any>[]): void {
const def = (type.ngComponentDef as ComponentDef<any>);
def.directiveDefs = () => directives.map(extractDirectiveDef);
@ -334,7 +334,7 @@ export function extractPipeDef(type: PipeType<any>): PipeDef<any> {
/**
* @codeGenApi
*/
export function ΔdefineNgModule<T>(def: {
export function ɵɵdefineNgModule<T>(def: {
/** Token representing the module. Used by DI. */
type: T;
@ -378,7 +378,7 @@ export function ΔdefineNgModule<T>(def: {
*
* @codeGenApi
*/
export function ΔsetNgModuleScope(type: any, scope: {
export function ɵɵsetNgModuleScope(type: any, scope: {
/** List of components, directives, and pipes declared by this module. */
declarations?: Type<any>[] | (() => Type<any>[]);
@ -480,7 +480,7 @@ function invertObject<T>(
* # Example
* ```ts
* class ShouldBeInherited {
* static ngBaseDef = ΔdefineBase({
* static ngBaseDef = ɵɵdefineBase({
* ...
* })
* }
@ -490,7 +490,7 @@ function invertObject<T>(
*
* @codeGenApi
*/
export function ΔdefineBase<T>(baseDefinition: {
export function ɵɵdefineBase<T>(baseDefinition: {
/**
* A map of input names.
*
@ -547,7 +547,7 @@ export function ΔdefineBase<T>(baseDefinition: {
* of properties.
*/
outputs?: {[P in keyof T]?: string};
}): ΔBaseDef<T> {
}): ɵɵBaseDef<T> {
const declaredInputs: {[P in keyof T]: string} = {} as any;
return {
inputs: invertObject<T>(baseDefinition.inputs as any, declaredInputs),
@ -564,7 +564,7 @@ export function ΔdefineBase<T>(baseDefinition: {
* class MyDirective {
* // Generated by Angular Template Compiler
* // [Symbol] syntax will not be supported by TypeScript until v2.7
* static ngDirectiveDef = ΔdefineDirective({
* static ngDirectiveDef = ɵɵdefineDirective({
* ...
* });
* }
@ -572,7 +572,7 @@ export function ΔdefineBase<T>(baseDefinition: {
*
* @codeGenApi
*/
export const ΔdefineDirective = ΔdefineComponent as any as<T>(directiveDefinition: {
export const ɵɵdefineDirective = ɵɵdefineComponent as any as<T>(directiveDefinition: {
/**
* Directive type, needed to configure the injector.
*/
@ -690,7 +690,7 @@ export const ΔdefineDirective = ΔdefineComponent as any as<T>(directiveDefinit
*
* @codeGenApi
*/
export function ΔdefinePipe<T>(pipeDef: {
export function ɵɵdefinePipe<T>(pipeDef: {
/** Name of the pipe. Used for matching pipes in template to pipe defs. */
name: string,

View File

@ -637,7 +637,7 @@ export class NodeInjector implements Injector {
/**
* @codeGenApi
*/
export function ΔgetFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)|null {
export function ɵɵgetFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)|null {
const typeAny = type as any;
const def = getComponentDef<T>(typeAny) || getDirectiveDef<T>(typeAny) ||
getPipeDef<T>(typeAny) || getInjectableDef<T>(typeAny) || getInjectorDef<T>(typeAny);
@ -650,9 +650,9 @@ export function ΔgetFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)
/**
* @codeGenApi
*/
export function ΔgetInheritedFactory<T>(type: Type<any>): (type: Type<T>) => T {
export function ɵɵgetInheritedFactory<T>(type: Type<any>): (type: Type<T>) => T {
const proto = Object.getPrototypeOf(type.prototype).constructor as Type<any>;
const factory = ΔgetFactoryOf<T>(proto);
const factory = ɵɵgetFactoryOf<T>(proto);
if (factory !== null) {
return factory;
} else {

View File

@ -12,7 +12,7 @@ import {ClassProvider, Provider} from '../di/interface/provider';
import {isClassProvider, isTypeProvider, providerToFactory} from '../di/r3_injector';
import {diPublicInInjector, getNodeInjectable, getOrCreateNodeInjectorForNode} from './di';
import {ΔdirectiveInject} from './instructions/all';
import {ɵɵdirectiveInject} from './instructions/all';
import {DirectiveDef} from './interfaces/definition';
import {NodeInjectorFactory} from './interfaces/injector';
import {TContainerNode, TElementContainerNode, TElementNode, TNodeProviderIndexes} from './interfaces/node';
@ -93,7 +93,7 @@ function resolveProvider(
if (isTypeProvider(provider) || !provider.multi) {
// Single provider case: the factory is created and pushed immediately
const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ΔdirectiveInject);
const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);
const existingFactoryIndex = indexOf(
token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount,
endIndex);
@ -255,7 +255,7 @@ function multiFactory(
this: NodeInjectorFactory, _: null, tData: TData, lData: LView, tNode: TElementNode) => any,
index: number, isViewProvider: boolean, isComponent: boolean,
f: () => any): NodeInjectorFactory {
const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ΔdirectiveInject);
const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject);
factory.multi = [];
factory.index = index;
factory.componentProviders = 0;

View File

@ -13,7 +13,7 @@ import {ComponentDef, DirectiveDef, DirectiveDefFeature, RenderFlags} from '../i
import {adjustActiveDirectiveSuperClassDepthPosition} from '../state';
import {isComponentDef} from '../util/view_utils';
import {ΔNgOnChangesFeature} from './ng_onchanges_feature';
import {ɵɵNgOnChangesFeature} from './ng_onchanges_feature';
function getSuperType(type: Type<any>): Type<any>&
{ngComponentDef?: ComponentDef<any>, ngDirectiveDef?: DirectiveDef<any>} {
@ -26,7 +26,7 @@ function getSuperType(type: Type<any>): Type<any>&
*
* @codeGenApi
*/
export function ΔInheritDefinitionFeature(definition: DirectiveDef<any>| ComponentDef<any>): void {
export function ɵɵInheritDefinitionFeature(definition: DirectiveDef<any>| ComponentDef<any>): void {
let superType = getSuperType(definition.type);
while (superType) {
@ -161,7 +161,7 @@ export function ΔInheritDefinitionFeature(definition: DirectiveDef<any>| Compon
definition.onInit = definition.onInit || superPrototype.ngOnInit;
if (superPrototype.ngOnChanges) {
ΔNgOnChangesFeature()(definition);
ɵɵNgOnChangesFeature()(definition);
}
}
}

View File

@ -41,7 +41,7 @@ type OnChangesExpando = OnChanges & {
*
* @codeGenApi
*/
export function ΔNgOnChangesFeature<T>(): DirectiveDefFeature {
export function ɵɵNgOnChangesFeature<T>(): DirectiveDefFeature {
// This option ensures that the ngOnChanges lifecycle hook will be inherited
// from superclasses (in InheritDefinitionFeature).
(NgOnChangesFeatureImpl as DirectiveDefFeature).ngInherit = true;

View File

@ -39,7 +39,7 @@ import {DirectiveDef} from '../interfaces/definition';
*
* @codeGenApi
*/
export function ΔProvidersFeature<T>(providers: Provider[], viewProviders: Provider[] = []) {
export function ɵɵProvidersFeature<T>(providers: Provider[], viewProviders: Provider[] = []) {
return (definition: DirectiveDef<T>) => {
definition.providersResolver =
(def: DirectiveDef<T>, processProvidersFn?: ProcessProvidersFunction) => {

View File

@ -16,7 +16,7 @@ import {assertDefined, assertEqual, assertGreaterThan} from '../util/assert';
import {attachPatchData} from './context_discovery';
import {attachI18nOpCodesDebug} from './debug';
import {ΔelementAttribute, Δload, ΔtextBinding} from './instructions/all';
import {ɵɵelementAttribute, ɵɵload, ɵɵtextBinding} from './instructions/all';
import {allocExpando, createNodeAtIndex} from './instructions/shared';
import {LContainer, NATIVE} from './interfaces/container';
import {COMMENT_MARKER, ELEMENT_MARKER, I18nMutateOpCode, I18nMutateOpCodes, I18nUpdateOpCode, I18nUpdateOpCodes, IcuType, TI18n, TIcu} from './interfaces/i18n';
@ -351,7 +351,7 @@ const parentIndexStack: number[] = [];
*
* @codeGenApi
*/
export function Δi18nStart(index: number, message: string, subTemplateIndex?: number): void {
export function ɵɵi18nStart(index: number, message: string, subTemplateIndex?: number): void {
const tView = getLView()[TVIEW];
ngDevMode && assertDefined(tView, `tView should be defined`);
i18nIndexStack[++i18nIndexStackPointer] = index;
@ -538,7 +538,7 @@ function appendI18nNode(tNode: TNode, parentTNode: TNode, previousTNode: TNode |
*
* @codeGenApi
*/
export function Δi18nPostprocess(
export function ɵɵi18nPostprocess(
message: string, replacements: {[key: string]: (string | string[])} = {}): string {
/**
* Step 1: resolve all multi-value placeholders like [<5B>#5<>|<7C>*1:1<><31>#2:1<>|<7C>#4:1<>]
@ -634,7 +634,7 @@ export function Δi18nPostprocess(
*
* @codeGenApi
*/
export function Δi18nEnd(): void {
export function ɵɵi18nEnd(): void {
const tView = getLView()[TVIEW];
ngDevMode && assertDefined(tView, `tView should be defined`);
i18nEndFirstPass(tView);
@ -742,7 +742,7 @@ function readCreateOpCodes(
const elementNodeIndex = opCode >>> I18nMutateOpCode.SHIFT_REF;
const attrName = createOpCodes[++i] as string;
const attrValue = createOpCodes[++i] as string;
ΔelementAttribute(elementNodeIndex, attrName, attrValue);
ɵɵelementAttribute(elementNodeIndex, attrName, attrValue);
break;
default:
throw new Error(`Unable to determine the type of mutate operation for "${opCode}"`);
@ -819,10 +819,10 @@ function readUpdateOpCodes(
case I18nUpdateOpCode.Attr:
const attrName = updateOpCodes[++j] as string;
const sanitizeFn = updateOpCodes[++j] as SanitizerFn | null;
ΔelementAttribute(nodeIndex, attrName, value, sanitizeFn);
ɵɵelementAttribute(nodeIndex, attrName, value, sanitizeFn);
break;
case I18nUpdateOpCode.Text:
ΔtextBinding(nodeIndex, value);
ɵɵtextBinding(nodeIndex, value);
break;
case I18nUpdateOpCode.IcuSwitch:
tIcuIndex = updateOpCodes[++j] as number;
@ -886,7 +886,7 @@ function removeNode(index: number, viewData: LView) {
nativeRemoveNode(viewData[RENDERER], removedPhRNode);
}
const slotValue = Δload(index) as RElement | RComment | LContainer | StylingContext;
const slotValue = ɵɵload(index) as RElement | RComment | LContainer | StylingContext;
if (isLContainer(slotValue)) {
const lContainer = slotValue as LContainer;
if (removedPhTNode.type !== TNodeType.Container) {
@ -923,9 +923,9 @@ function removeNode(index: number, viewData: LView) {
*
* @codeGenApi
*/
export function Δi18n(index: number, message: string, subTemplateIndex?: number): void {
Δi18nStart(index, message, subTemplateIndex);
Δi18nEnd();
export function ɵɵi18n(index: number, message: string, subTemplateIndex?: number): void {
ɵɵi18nStart(index, message, subTemplateIndex);
ɵɵi18nEnd();
}
/**
@ -936,7 +936,7 @@ export function Δi18n(index: number, message: string, subTemplateIndex?: number
*
* @codeGenApi
*/
export function Δi18nAttributes(index: number, values: string[]): void {
export function ɵɵi18nAttributes(index: number, values: string[]): void {
const tView = getLView()[TVIEW];
ngDevMode && assertDefined(tView, `tView should be defined`);
if (tView.firstTemplatePass && tView.data[index + HEADER_OFFSET] === null) {
@ -968,7 +968,7 @@ function i18nAttributesFirstPass(tView: TView, index: number, values: string[])
addAllToArray(
generateBindingUpdateOpCodes(value, previousElementIndex, attrName), updateOpCodes);
} else {
ΔelementAttribute(previousElementIndex, attrName, value);
ɵɵelementAttribute(previousElementIndex, attrName, value);
}
}
}
@ -988,7 +988,7 @@ let shiftsCounter = 0;
*
* @codeGenApi
*/
export function Δi18nExp<T>(expression: T | NO_CHANGE): void {
export function ɵɵi18nExp<T>(expression: T | NO_CHANGE): void {
if (expression !== NO_CHANGE) {
changeMask = changeMask | (1 << shiftsCounter);
}
@ -1003,7 +1003,7 @@ export function Δi18nExp<T>(expression: T | NO_CHANGE): void {
*
* @codeGenApi
*/
export function Δi18nApply(index: number) {
export function ɵɵi18nApply(index: number) {
if (shiftsCounter) {
const lView = getLView();
const tView = lView[TVIEW];
@ -1633,7 +1633,7 @@ const LOCALIZE_PH_REGEXP = /\{\$(.*?)\}/g;
* @publicApi
* @deprecated this method is temporary & should not be used as it will be removed soon
*/
export function Δi18nLocalize(input: string, placeholders: {[key: string]: string} = {}) {
export function ɵɵi18nLocalize(input: string, placeholders: {[key: string]: string} = {}) {
if (typeof TRANSLATIONS[input] !== 'undefined') { // to account for empty string
input = TRANSLATIONS[input];
}

View File

@ -6,109 +6,109 @@
* found in the LICENSE file at https://angular.io/license
*/
import {LifecycleHooksFeature, renderComponent, whenRendered} from './component';
import {ΔdefineBase, ΔdefineComponent, ΔdefineDirective, ΔdefineNgModule, ΔdefinePipe, ΔsetComponentScope, ΔsetNgModuleScope} from './definition';
import {ΔInheritDefinitionFeature} from './features/inherit_definition_feature';
import {ΔNgOnChangesFeature} from './features/ng_onchanges_feature';
import {ΔProvidersFeature} from './features/providers_feature';
import {ComponentDef, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveType, PipeDef, ΔBaseDef, ΔComponentDefWithMeta, ΔDirectiveDefWithMeta, ΔPipeDefWithMeta} from './interfaces/definition';
import {ɵɵdefineBase, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵsetComponentScope, ɵɵsetNgModuleScope} from './definition';
import {ɵɵInheritDefinitionFeature} from './features/inherit_definition_feature';
import {ɵɵNgOnChangesFeature} from './features/ng_onchanges_feature';
import {ɵɵProvidersFeature} from './features/providers_feature';
import {ComponentDef, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveType, PipeDef, ɵɵBaseDef, ɵɵComponentDefWithMeta, ɵɵDirectiveDefWithMeta, ɵɵPipeDefWithMeta} from './interfaces/definition';
import {getComponent, getDirectives, getHostElement, getRenderedText} from './util/discovery_utils';
export {ComponentFactory, ComponentFactoryResolver, ComponentRef, injectComponentFactoryResolver} from './component_ref';
export {ΔgetFactoryOf, ΔgetInheritedFactory} from './di';
export {ɵɵgetFactoryOf, ɵɵgetInheritedFactory} from './di';
// clang-format off
export {
detectChanges,
markDirty,
store,
tick,
ΔallocHostVars,
Δbind,
ΔcomponentHostSyntheticListener,
ΔcomponentHostSyntheticProperty,
ɵɵallocHostVars,
ɵɵbind,
ɵɵcomponentHostSyntheticListener,
ɵɵcomponentHostSyntheticProperty,
Δcontainer,
ΔcontainerRefreshEnd,
ΔcontainerRefreshStart,
ɵɵcontainer,
ɵɵcontainerRefreshEnd,
ɵɵcontainerRefreshStart,
ΔdirectiveInject,
ɵɵdirectiveInject,
Δelement,
ΔelementAttribute,
ΔelementClassProp,
ΔelementContainerEnd,
ɵɵelement,
ɵɵelementAttribute,
ɵɵelementClassProp,
ɵɵelementContainerEnd,
ΔelementContainerStart,
ΔelementEnd,
ɵɵelementContainerStart,
ɵɵelementEnd,
ΔelementHostAttrs,
ΔelementHostClassProp,
ΔelementHostStyleProp,
ΔelementHostStyling,
ΔelementHostStylingApply,
ΔelementHostStylingMap,
ΔelementProperty,
ΔelementStart,
ΔelementStyleProp,
ΔelementStyling,
ΔelementStylingApply,
ΔelementStylingMap,
ΔembeddedViewEnd,
ɵɵelementHostAttrs,
ɵɵelementHostClassProp,
ɵɵelementHostStyleProp,
ɵɵelementHostStyling,
ɵɵelementHostStylingApply,
ɵɵelementHostStylingMap,
ɵɵelementProperty,
ɵɵelementStart,
ɵɵelementStyleProp,
ɵɵelementStyling,
ɵɵelementStylingApply,
ɵɵelementStylingMap,
ɵɵembeddedViewEnd,
ΔembeddedViewStart,
ɵɵembeddedViewStart,
ΔgetCurrentView,
ΔinjectAttribute,
ɵɵgetCurrentView,
ɵɵinjectAttribute,
Δinterpolation1,
Δinterpolation2,
Δinterpolation3,
Δinterpolation4,
Δinterpolation5,
Δinterpolation6,
Δinterpolation7,
Δinterpolation8,
ΔinterpolationV,
ɵɵinterpolation1,
ɵɵinterpolation2,
ɵɵinterpolation3,
ɵɵinterpolation4,
ɵɵinterpolation5,
ɵɵinterpolation6,
ɵɵinterpolation7,
ɵɵinterpolation8,
ɵɵinterpolationV,
Δlistener,
Δload,
ɵɵlistener,
ɵɵload,
ΔnamespaceHTML,
ΔnamespaceMathML,
ΔnamespaceSVG,
ɵɵnamespaceHTML,
ɵɵnamespaceMathML,
ɵɵnamespaceSVG,
ΔnextContext,
ɵɵnextContext,
Δprojection,
ΔprojectionDef,
Δproperty,
ɵɵprojection,
ɵɵprojectionDef,
ɵɵproperty,
Δreference,
ɵɵreference,
Δselect,
Δtemplate,
ɵɵselect,
ɵɵtemplate,
Δtext,
ΔtextBinding} from './instructions/all';
ɵɵtext,
ɵɵtextBinding} from './instructions/all';
export {RenderFlags} from './interfaces/definition';
export {CssSelectorList} from './interfaces/projection';
export {
ΔrestoreView,
ɵɵrestoreView,
ΔenableBindings,
ΔdisableBindings,
ɵɵenableBindings,
ɵɵdisableBindings,
} from './state';
export {
Δi18n,
Δi18nAttributes,
Δi18nExp,
Δi18nStart,
Δi18nEnd,
Δi18nApply,
Δi18nPostprocess,
ɵɵi18n,
ɵɵi18nAttributes,
ɵɵi18nExp,
ɵɵi18nStart,
ɵɵi18nEnd,
ɵɵi18nApply,
ɵɵi18nPostprocess,
i18nConfigureLocalize,
Δi18nLocalize,
ɵɵi18nLocalize,
} from './i18n';
export {NgModuleFactory, NgModuleRef, NgModuleType} from './ng_module_ref';
@ -122,71 +122,71 @@ export {
} from './metadata';
export {
Δpipe,
ΔpipeBind1,
ΔpipeBind2,
ΔpipeBind3,
ΔpipeBind4,
ΔpipeBindV,
ɵɵpipe,
ɵɵpipeBind1,
ɵɵpipeBind2,
ɵɵpipeBind3,
ɵɵpipeBind4,
ɵɵpipeBindV,
} from './pipe';
export {
ΔqueryRefresh,
ΔviewQuery,
ΔstaticViewQuery,
ΔloadViewQuery,
ΔcontentQuery,
ΔloadContentQuery,
ΔstaticContentQuery
ɵɵqueryRefresh,
ɵɵviewQuery,
ɵɵstaticViewQuery,
ɵɵloadViewQuery,
ɵɵcontentQuery,
ɵɵloadContentQuery,
ɵɵstaticContentQuery
} from './query';
export {
ΔpureFunction0,
ΔpureFunction1,
ΔpureFunction2,
ΔpureFunction3,
ΔpureFunction4,
ΔpureFunction5,
ΔpureFunction6,
ΔpureFunction7,
ΔpureFunction8,
ΔpureFunctionV,
ɵɵpureFunction0,
ɵɵpureFunction1,
ɵɵpureFunction2,
ɵɵpureFunction3,
ɵɵpureFunction4,
ɵɵpureFunction5,
ɵɵpureFunction6,
ɵɵpureFunction7,
ɵɵpureFunction8,
ɵɵpureFunctionV,
} from './pure_function';
export {ΔtemplateRefExtractor} from './view_engine_compatibility_prebound';
export {ɵɵtemplateRefExtractor} from './view_engine_compatibility_prebound';
export {ΔresolveWindow, ΔresolveDocument, ΔresolveBody} from './util/misc_utils';
export {ɵɵresolveWindow, ɵɵresolveDocument, ɵɵresolveBody} from './util/misc_utils';
// clang-format on
export {
ΔBaseDef,
ɵɵBaseDef,
ComponentDef,
ΔComponentDefWithMeta,
ɵɵComponentDefWithMeta,
ComponentTemplate,
ComponentType,
DirectiveDef,
DirectiveDefFlags,
ΔDirectiveDefWithMeta,
ɵɵDirectiveDefWithMeta,
DirectiveType,
ΔNgOnChangesFeature,
ΔInheritDefinitionFeature,
ΔProvidersFeature,
ɵɵNgOnChangesFeature,
ɵɵInheritDefinitionFeature,
ɵɵProvidersFeature,
PipeDef,
ΔPipeDefWithMeta,
ɵɵPipeDefWithMeta,
LifecycleHooksFeature,
ΔdefineComponent,
ΔdefineDirective,
ΔdefineNgModule,
ΔdefineBase,
ΔdefinePipe,
ɵɵdefineComponent,
ɵɵdefineDirective,
ɵɵdefineNgModule,
ɵɵdefineBase,
ɵɵdefinePipe,
getHostElement,
getComponent,
getDirectives,
getRenderedText,
renderComponent,
ΔsetComponentScope,
ΔsetNgModuleScope,
ɵɵsetComponentScope,
ɵɵsetNgModuleScope,
whenRendered,
};

View File

@ -19,7 +19,7 @@ import {NO_CHANGE} from '../tokens';
*
* @codeGenApi
*/
export function ΔallocHostVars(count: number): void {
export function ɵɵallocHostVars(count: number): void {
const lView = getLView();
const tView = lView[TVIEW];
if (!tView.firstTemplatePass) return;

View File

@ -30,7 +30,7 @@ import {addToViewTree, createDirectivesAndLocals, createLContainer, createNodeAt
*
* @codeGenApi
*/
export function Δcontainer(index: number): void {
export function ɵɵcontainer(index: number): void {
const tNode = containerInternal(index, null, null);
const lView = getLView();
if (lView[TVIEW].firstTemplatePass) {
@ -59,7 +59,7 @@ export function Δcontainer(index: number): void {
*
* @codeGenApi
*/
export function Δtemplate(
export function ɵɵtemplate(
index: number, templateFn: ComponentTemplate<any>| null, consts: number, vars: number,
tagName?: string | null, attrs?: TAttributes | null, localRefs?: string[] | null,
localRefExtractor?: LocalRefExtractor) {
@ -87,7 +87,7 @@ export function Δtemplate(
*
* @codeGenApi
*/
export function ΔcontainerRefreshStart(index: number): void {
export function ɵɵcontainerRefreshStart(index: number): void {
const lView = getLView();
const tView = lView[TVIEW];
let previousOrParentTNode = loadInternal(tView.data, index) as TNode;
@ -110,7 +110,7 @@ export function ΔcontainerRefreshStart(index: number): void {
*
* @codeGenApi
*/
export function ΔcontainerRefreshEnd(): void {
export function ɵɵcontainerRefreshEnd(): void {
let previousOrParentTNode = getPreviousOrParentTNode();
if (getIsParent()) {
setIsParent(false);

View File

@ -23,9 +23,9 @@ import {getLView, getPreviousOrParentTNode} from '../state';
* class SomeDirective {
* constructor(directive: DirectiveA) {}
*
* static ngDirectiveDef = ΔdefineDirective({
* static ngDirectiveDef = ɵɵdefineDirective({
* type: SomeDirective,
* factory: () => new SomeDirective(ΔdirectiveInject(DirectiveA))
* factory: () => new SomeDirective(ɵɵdirectiveInject(DirectiveA))
* });
* }
* ```
@ -35,9 +35,9 @@ import {getLView, getPreviousOrParentTNode} from '../state';
*
* @codeGenApi
*/
export function ΔdirectiveInject<T>(token: Type<T>| InjectionToken<T>): T;
export function ΔdirectiveInject<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags): T;
export function ΔdirectiveInject<T>(
export function ɵɵdirectiveInject<T>(token: Type<T>| InjectionToken<T>): T;
export function ɵɵdirectiveInject<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags): T;
export function ɵɵdirectiveInject<T>(
token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {
token = resolveForwardRef(token);
return getOrCreateInjectable<T>(
@ -50,6 +50,6 @@ export function ΔdirectiveInject<T>(
*
* @codeGenApi
*/
export function ΔinjectAttribute(attrNameToInject: string): string|null {
export function ɵɵinjectAttribute(attrNameToInject: string): string|null {
return injectAttributeImpl(getPreviousOrParentTNode(), attrNameToInject);
}

View File

@ -44,7 +44,7 @@ import {getActiveDirectiveStylingIndex} from './styling';
*
* @codeGenApi
*/
export function ΔelementStart(
export function ɵɵelementStart(
index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {
const lView = getLView();
const tView = lView[TVIEW];
@ -129,7 +129,7 @@ export function ΔelementStart(
*
* @codeGenApi
*/
export function ΔelementEnd(): void {
export function ɵɵelementEnd(): void {
let previousOrParentTNode = getPreviousOrParentTNode();
if (getIsParent()) {
setIsParent(false);
@ -181,10 +181,10 @@ export function ΔelementEnd(): void {
*
* @codeGenApi
*/
export function Δelement(
export function ɵɵelement(
index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {
ΔelementStart(index, name, attrs, localRefs);
ΔelementEnd();
ɵɵelementStart(index, name, attrs, localRefs);
ɵɵelementEnd();
}
@ -200,7 +200,7 @@ export function Δelement(
*
* @codeGenApi
*/
export function ΔelementAttribute(
export function ɵɵelementAttribute(
index: number, name: string, value: any, sanitizer?: SanitizerFn | null,
namespace?: string): void {
if (value !== NO_CHANGE) {
@ -268,7 +268,7 @@ export function ΔelementAttribute(
*
* @codeGenApi
*/
export function ΔelementHostAttrs(attrs: TAttributes) {
export function ɵɵelementHostAttrs(attrs: TAttributes) {
const hostElementIndex = getSelectedIndex();
const lView = getLView();
const tNode = getTNode(hostElementIndex, lView);

View File

@ -31,7 +31,7 @@ import {createDirectivesAndLocals, createNodeAtIndex, executeContentQueries, set
*
* @codeGenApi
*/
export function ΔelementContainerStart(
export function ɵɵelementContainerStart(
index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void {
const lView = getLView();
const tView = lView[TVIEW];
@ -72,7 +72,7 @@ export function ΔelementContainerStart(
*
* @codeGenApi
*/
export function ΔelementContainerEnd(): void {
export function ɵɵelementContainerEnd(): void {
let previousOrParentTNode = getPreviousOrParentTNode();
const lView = getLView();
const tView = lView[TVIEW];

View File

@ -26,7 +26,8 @@ import {assignTViewNodeToLView, createLView, createTView, refreshDescendantViews
*
* @codeGenApi
*/
export function ΔembeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags {
export function ɵɵembeddedViewStart(
viewBlockId: number, consts: number, vars: number): RenderFlags {
const lView = getLView();
const previousOrParentTNode = getPreviousOrParentTNode();
// The previous node can be a view node if we are processing an inline for loop
@ -129,7 +130,7 @@ function scanForView(lContainer: LContainer, startIdx: number, viewBlockId: numb
*
* @codeGenApi
*/
export function ΔembeddedViewEnd(): void {
export function ɵɵembeddedViewEnd(): void {
const lView = getLView();
const viewHost = lView[T_HOST];

View File

@ -17,6 +17,6 @@ import {getLView} from '../state';
*
* @codeGenApi
*/
export function ΔgetCurrentView(): OpaqueViewState {
export function ɵɵgetCurrentView(): OpaqueViewState {
return getLView() as any as OpaqueViewState;
}

View File

@ -31,7 +31,7 @@ import {BindingDirection, generatePropertyAliases, getCleanup, handleError, load
*
* @codeGenApi
*/
export function Δlistener(
export function ɵɵlistener(
eventName: string, listenerFn: (e?: any) => any, useCapture = false,
eventTargetResolver?: GlobalTargetResolver): void {
listenerInternal(eventName, listenerFn, useCapture, eventTargetResolver);
@ -58,7 +58,7 @@ export function Δlistener(
*
* @codeGenApi
*/
export function ΔcomponentHostSyntheticListener<T>(
export function ɵɵcomponentHostSyntheticListener<T>(
eventName: string, listenerFn: (e?: any) => any, useCapture = false,
eventTargetResolver?: GlobalTargetResolver): void {
listenerInternal(eventName, listenerFn, useCapture, eventTargetResolver, loadComponentRenderer);

View File

@ -6,4 +6,4 @@
* found in the LICENSE file at https://angular.io/license
*/
export {ΔnamespaceHTML, ΔnamespaceMathML, ΔnamespaceSVG} from '../state';
export {ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG} from '../state';

View File

@ -19,6 +19,6 @@ import {nextContextImpl} from '../state';
*
* @codeGenApi
*/
export function ΔnextContext<T = any>(level: number = 1): T {
export function ɵɵnextContext<T = any>(level: number = 1): T {
return nextContextImpl(level);
}

View File

@ -39,7 +39,7 @@ import {createNodeAtIndex} from './shared';
*
* @codeGenApi
*/
export function ΔprojectionDef(selectors?: CssSelectorList[]): void {
export function ɵɵprojectionDef(selectors?: CssSelectorList[]): void {
const componentNode = findComponentView(getLView())[T_HOST] as TElementNode;
if (!componentNode.projection) {
@ -78,7 +78,7 @@ export function ΔprojectionDef(selectors?: CssSelectorList[]): void {
*
* @codeGenApi
*/
export function Δprojection(
export function ɵɵprojection(
nodeIndex: number, selectorIndex: number = 0, attrs?: TAttributes): void {
const lView = getLView();
const tProjectionNode =

View File

@ -34,13 +34,13 @@ import {TsickleIssue1009, elementPropertyInternal, loadComponentRenderer, storeB
*
* @codeGenApi
*/
export function Δproperty<T>(
export function ɵɵproperty<T>(
propName: string, value: T, sanitizer?: SanitizerFn | null,
nativeOnly?: boolean): TsickleIssue1009 {
const index = getSelectedIndex();
const bindReconciledValue = Δbind(value);
const bindReconciledValue = ɵɵbind(value);
elementPropertyInternal(index, propName, bindReconciledValue, sanitizer, nativeOnly);
return Δproperty;
return ɵɵproperty;
}
/**
@ -50,7 +50,7 @@ export function Δproperty<T>(
*
* @codeGenApi
*/
export function Δbind<T>(value: T): T|NO_CHANGE {
export function ɵɵbind<T>(value: T): T|NO_CHANGE {
const lView = getLView();
const bindingIndex = lView[BINDING_INDEX]++;
storeBindingMetadata(lView);
@ -75,7 +75,7 @@ export function Δbind<T>(value: T): T|NO_CHANGE {
*
* @codeGenApi
*/
export function ΔelementProperty<T>(
export function ɵɵelementProperty<T>(
index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,
nativeOnly?: boolean): void {
elementPropertyInternal(index, propName, value, sanitizer, nativeOnly);
@ -104,7 +104,7 @@ export function ΔelementProperty<T>(
*
* @codeGenApi
*/
export function ΔcomponentHostSyntheticProperty<T>(
export function ɵɵcomponentHostSyntheticProperty<T>(
index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,
nativeOnly?: boolean) {
elementPropertyInternal(index, propName, value, sanitizer, nativeOnly, loadComponentRenderer);

View File

@ -29,7 +29,7 @@ import {TsickleIssue1009, elementPropertyInternal, storeBindingMetadata} from '.
*
* @codeGenApi
*/
export function ΔinterpolationV(values: any[]): string|NO_CHANGE {
export function ɵɵinterpolationV(values: any[]): string|NO_CHANGE {
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
let different = false;
@ -74,7 +74,7 @@ export function ΔinterpolationV(values: any[]): string|NO_CHANGE {
*
* @codeGenApi
*/
export function Δinterpolation1(prefix: string, v0: any, suffix: string): string|NO_CHANGE {
export function ɵɵinterpolation1(prefix: string, v0: any, suffix: string): string|NO_CHANGE {
const lView = getLView();
const different = bindingUpdated(lView, lView[BINDING_INDEX]++, v0);
storeBindingMetadata(lView, prefix, suffix);
@ -86,7 +86,7 @@ export function Δinterpolation1(prefix: string, v0: any, suffix: string): strin
*
* @codeGenApi
*/
export function Δinterpolation2(
export function ɵɵinterpolation2(
prefix: string, v0: any, i0: string, v1: any, suffix: string): string|NO_CHANGE {
const lView = getLView();
const bindingIndex = lView[BINDING_INDEX];
@ -107,7 +107,7 @@ export function Δinterpolation2(
*
* @codeGenApi
*/
export function Δinterpolation3(
export function ɵɵinterpolation3(
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): string|
NO_CHANGE {
const lView = getLView();
@ -133,7 +133,7 @@ export function Δinterpolation3(
*
* @codeGenApi
*/
export function Δinterpolation4(
export function ɵɵinterpolation4(
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
suffix: string): string|NO_CHANGE {
const lView = getLView();
@ -161,7 +161,7 @@ export function Δinterpolation4(
*
* @codeGenApi
*/
export function Δinterpolation5(
export function ɵɵinterpolation5(
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
i3: string, v4: any, suffix: string): string|NO_CHANGE {
const lView = getLView();
@ -191,7 +191,7 @@ export function Δinterpolation5(
*
* @codeGenApi
*/
export function Δinterpolation6(
export function ɵɵinterpolation6(
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
i3: string, v4: any, i4: string, v5: any, suffix: string): string|NO_CHANGE {
const lView = getLView();
@ -222,7 +222,7 @@ export function Δinterpolation6(
*
* @codeGenApi
*/
export function Δinterpolation7(
export function ɵɵinterpolation7(
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string|
NO_CHANGE {
@ -256,7 +256,7 @@ export function Δinterpolation7(
*
* @codeGenApi
*/
export function Δinterpolation8(
export function ɵɵinterpolation8(
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,
suffix: string): string|NO_CHANGE {
@ -292,7 +292,7 @@ export function Δinterpolation8(
/**
* Shared reference to a string, used in `ΔpropertyInterpolate`.
* Shared reference to a string, used in `ɵɵpropertyInterpolate`.
*/
const EMPTY_STRING = '';
@ -310,7 +310,7 @@ const EMPTY_STRING = '';
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate('title', v0);
* ɵɵpropertyInterpolate('title', v0);
* ```
*
* If the property name also exists as an input property on one of the element's directives,
@ -323,9 +323,9 @@ const EMPTY_STRING = '';
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate(propName: string, v0: any): TsickleIssue1009 {
ΔpropertyInterpolate1(propName, EMPTY_STRING, v0, EMPTY_STRING);
return ΔpropertyInterpolate;
export function ɵɵpropertyInterpolate(propName: string, v0: any): TsickleIssue1009 {
ɵɵpropertyInterpolate1(propName, EMPTY_STRING, v0, EMPTY_STRING);
return ɵɵpropertyInterpolate;
}
@ -342,7 +342,7 @@ export function ΔpropertyInterpolate(propName: string, v0: any): TsickleIssue10
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate1('title', 'prefix', v0, 'suffix');
* ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');
* ```
*
* If the property name also exists as an input property on one of the element's directives,
@ -355,11 +355,11 @@ export function ΔpropertyInterpolate(propName: string, v0: any): TsickleIssue10
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate1(
export function ɵɵpropertyInterpolate1(
propName: string, prefix: string, v0: any, suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(index, propName, Δinterpolation1(prefix, v0, suffix));
return ΔpropertyInterpolate1;
elementPropertyInternal(index, propName, ɵɵinterpolation1(prefix, v0, suffix));
return ɵɵpropertyInterpolate1;
}
/**
@ -375,7 +375,7 @@ export function ΔpropertyInterpolate1(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
* ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
* ```
*
* If the property name also exists as an input property on one of the element's directives,
@ -390,12 +390,12 @@ export function ΔpropertyInterpolate1(
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate2(
export function ɵɵpropertyInterpolate2(
propName: string, prefix: string, v0: any, i0: string, v1: any,
suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(index, propName, Δinterpolation2(prefix, v0, i0, v1, suffix));
return ΔpropertyInterpolate2;
elementPropertyInternal(index, propName, ɵɵinterpolation2(prefix, v0, i0, v1, suffix));
return ɵɵpropertyInterpolate2;
}
/**
@ -411,7 +411,7 @@ export function ΔpropertyInterpolate2(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate3(
* ɵɵpropertyInterpolate3(
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
* ```
*
@ -429,12 +429,12 @@ export function ΔpropertyInterpolate2(
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate3(
export function ɵɵpropertyInterpolate3(
propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any,
suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(index, propName, Δinterpolation3(prefix, v0, i0, v1, i1, v2, suffix));
return ΔpropertyInterpolate3;
elementPropertyInternal(index, propName, ɵɵinterpolation3(prefix, v0, i0, v1, i1, v2, suffix));
return ɵɵpropertyInterpolate3;
}
/**
@ -450,7 +450,7 @@ export function ΔpropertyInterpolate3(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate4(
* ɵɵpropertyInterpolate4(
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
* ```
*
@ -470,13 +470,13 @@ export function ΔpropertyInterpolate3(
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate4(
export function ɵɵpropertyInterpolate4(
propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,
v3: any, suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(
index, propName, Δinterpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix));
return ΔpropertyInterpolate4;
index, propName, ɵɵinterpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix));
return ɵɵpropertyInterpolate4;
}
/**
@ -492,7 +492,7 @@ export function ΔpropertyInterpolate4(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate5(
* ɵɵpropertyInterpolate5(
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
* ```
*
@ -514,13 +514,13 @@ export function ΔpropertyInterpolate4(
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate5(
export function ɵɵpropertyInterpolate5(
propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,
v3: any, i3: string, v4: any, suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(
index, propName, Δinterpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix));
return ΔpropertyInterpolate5;
index, propName, ɵɵinterpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix));
return ɵɵpropertyInterpolate5;
}
/**
@ -536,7 +536,7 @@ export function ΔpropertyInterpolate5(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate6(
* ɵɵpropertyInterpolate6(
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
* ```
*
@ -560,13 +560,14 @@ export function ΔpropertyInterpolate5(
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate6(
export function ɵɵpropertyInterpolate6(
propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,
v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(
index, propName, Δinterpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix));
return ΔpropertyInterpolate6;
index, propName,
ɵɵinterpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix));
return ɵɵpropertyInterpolate6;
}
/**
@ -582,7 +583,7 @@ export function ΔpropertyInterpolate6(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate7(
* ɵɵpropertyInterpolate7(
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
* ```
*
@ -608,15 +609,15 @@ export function ΔpropertyInterpolate6(
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate7(
export function ɵɵpropertyInterpolate7(
propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,
v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any,
suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(
index, propName,
Δinterpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix));
return ΔpropertyInterpolate7;
ɵɵinterpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix));
return ɵɵpropertyInterpolate7;
}
/**
@ -632,7 +633,7 @@ export function ΔpropertyInterpolate7(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolate8(
* ɵɵpropertyInterpolate8(
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
* ```
*
@ -660,15 +661,15 @@ export function ΔpropertyInterpolate7(
* @param suffix Static value used for concatenation only.
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolate8(
export function ɵɵpropertyInterpolate8(
propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,
v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,
suffix: string): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(
index, propName,
Δinterpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix));
return ΔpropertyInterpolate8;
ɵɵinterpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix));
return ɵɵpropertyInterpolate8;
}
/**
@ -684,7 +685,7 @@ export function ΔpropertyInterpolate8(
* Its compiled representation is::
*
* ```ts
* ΔpropertyInterpolateV(
* ɵɵpropertyInterpolateV(
* 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
* 'suffix']);
* ```
@ -699,9 +700,9 @@ export function ΔpropertyInterpolate8(
* (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
* @returns itself, so that it may be chained.
*/
export function ΔpropertyInterpolateV(propName: string, values: any[]): TsickleIssue1009 {
export function ɵɵpropertyInterpolateV(propName: string, values: any[]): TsickleIssue1009 {
const index = getSelectedIndex();
elementPropertyInternal(index, propName, ΔinterpolationV(values));
return ΔpropertyInterpolateV;
elementPropertyInternal(index, propName, ɵɵinterpolationV(values));
return ɵɵpropertyInterpolateV;
}

View File

@ -31,7 +31,7 @@ import {getCheckNoChangesMode, getLView, setSelectedIndex} from '../state';
*
* @codeGenApi
*/
export function Δselect(index: number): void {
export function ɵɵselect(index: number): void {
ngDevMode && assertGreaterThan(index, -1, 'Invalid index');
ngDevMode &&
assertLessThan(

View File

@ -30,7 +30,7 @@ import {StylingContext} from '../interfaces/styling';
import {BINDING_INDEX, CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTEXT, DECLARATION_VIEW, ExpandoInstructions, FLAGS, HEADER_OFFSET, HOST, INJECTOR, InitPhaseState, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, RENDERER_FACTORY, RootContext, RootContextFlags, SANITIZER, TData, TVIEW, TView, T_HOST} from '../interfaces/view';
import {assertNodeOfPossibleTypes, assertNodeType} from '../node_assert';
import {isNodeMatchingSelectorList} from '../node_selector_matcher';
import {enterView, getBindingsEnabled, getCheckNoChangesMode, getIsParent, getLView, getNamespace, getPreviousOrParentTNode, incrementActiveDirectiveId, isCreationMode, leaveView, resetComponentState, setActiveHostElement, setBindingRoot, setCheckNoChangesMode, setCurrentDirectiveDef, setCurrentQueryIndex, setIsParent, setPreviousOrParentTNode, setSelectedIndex, ΔnamespaceHTML} from '../state';
import {enterView, getBindingsEnabled, getCheckNoChangesMode, getIsParent, getLView, getNamespace, getPreviousOrParentTNode, incrementActiveDirectiveId, isCreationMode, leaveView, resetComponentState, setActiveHostElement, setBindingRoot, setCheckNoChangesMode, setCurrentDirectiveDef, setCurrentQueryIndex, setIsParent, setPreviousOrParentTNode, setSelectedIndex, ɵɵnamespaceHTML} from '../state';
import {initializeStaticContext as initializeStaticStylingContext} from '../styling/class_and_style_bindings';
import {ANIMATION_PROP_PREFIX, isAnimationProp} from '../styling/util';
import {NO_CHANGE} from '../tokens';
@ -431,7 +431,7 @@ export function renderEmbeddedTemplate<T>(viewToRender: LView, tView: TView, con
oldView = enterView(viewToRender, viewToRender[T_HOST]);
resetPreOrderHookFlags(viewToRender);
ΔnamespaceHTML();
ɵɵnamespaceHTML();
// Reset the selected index so we can assert that `select` was called later
setSelectedIndex(-1);
@ -466,7 +466,7 @@ function renderComponentOrTemplate<T>(
if (creationModeIsActive) {
// creation mode pass
if (templateFn) {
ΔnamespaceHTML();
ɵɵnamespaceHTML();
// Reset the selected index so we can assert that `select` was called later
setSelectedIndex(-1);
@ -1672,7 +1672,7 @@ export function checkView<T>(hostView: LView, component: T) {
try {
resetPreOrderHookFlags(hostView);
ΔnamespaceHTML();
ɵɵnamespaceHTML();
creationMode && executeViewQueryFn(RenderFlags.Create, hostTView, component);
// Reset the selected index so we can assert that `select` was called later

View File

@ -33,7 +33,7 @@ export function store<T>(index: number, value: T): void {
*
* @codeGenApi
*/
export function Δreference<T>(index: number) {
export function ɵɵreference<T>(index: number) {
const contextLView = getContextLView();
return loadInternal<T>(contextLView, index);
}
@ -43,6 +43,6 @@ export function Δreference<T>(index: number) {
*
* @codeGenApi
*/
export function Δload<T>(index: number): T {
export function ɵɵload<T>(index: number): T {
return loadInternal<T>(getLView(), index);
}

View File

@ -64,7 +64,7 @@ import {scheduleTick, setInputsForProperty} from './shared';
*
* @codeGenApi
*/
export function ΔelementStyling(
export function ɵɵelementStyling(
classBindingNames?: string[] | null, styleBindingNames?: string[] | null,
styleSanitizer?: StyleSanitizeFn | null): void {
const tNode = getPreviousOrParentTNode();
@ -106,7 +106,7 @@ export function ΔelementStyling(
*
* @codeGenApi
*/
export function ΔelementHostStyling(
export function ɵɵelementHostStyling(
classBindingNames?: string[] | null, styleBindingNames?: string[] | null,
styleSanitizer?: StyleSanitizeFn | null): void {
const tNode = getPreviousOrParentTNode();
@ -166,7 +166,7 @@ function initElementStyling(
*
* @codeGenApi
*/
export function ΔelementStyleProp(
export function ɵɵelementStyleProp(
index: number, styleIndex: number, value: string | number | String | PlayerFactory | null,
suffix?: string | null, forceOverride?: boolean): void {
const valueToAdd = resolveStylePropValue(value, suffix);
@ -200,7 +200,7 @@ export function ΔelementStyleProp(
*
* @codeGenApi
*/
export function ΔelementHostStyleProp(
export function ɵɵelementHostStyleProp(
styleIndex: number, value: string | number | String | PlayerFactory | null,
suffix?: string | null, forceOverride?: boolean): void {
const directiveStylingIndex = getActiveDirectiveStylingIndex();
@ -253,7 +253,7 @@ function resolveStylePropValue(
*
* @codeGenApi
*/
export function ΔelementClassProp(
export function ɵɵelementClassProp(
index: number, classIndex: number, value: boolean | PlayerFactory,
forceOverride?: boolean): void {
const input = (value instanceof BoundPlayerFactory) ?
@ -283,7 +283,7 @@ export function ΔelementClassProp(
*
* @codeGenApi
*/
export function ΔelementHostClassProp(
export function ɵɵelementHostClassProp(
classIndex: number, value: boolean | PlayerFactory, forceOverride?: boolean): void {
const directiveStylingIndex = getActiveDirectiveStylingIndex();
const hostElementIndex = getSelectedIndex();
@ -326,7 +326,7 @@ function booleanOrNull(value: any): boolean|null {
*
* @codeGenApi
*/
export function ΔelementStylingMap(
export function ɵɵelementStylingMap(
index: number, classes: {[key: string]: any} | string | NO_CHANGE | null,
styles?: {[styleName: string]: any} | NO_CHANGE | null): void {
const lView = getLView();
@ -379,7 +379,7 @@ export function ΔelementStylingMap(
*
* @codeGenApi
*/
export function ΔelementHostStylingMap(
export function ɵɵelementHostStylingMap(
classes: {[key: string]: any} | string | NO_CHANGE | null,
styles?: {[styleName: string]: any} | NO_CHANGE | null): void {
const directiveStylingIndex = getActiveDirectiveStylingIndex();
@ -405,7 +405,7 @@ export function ΔelementHostStylingMap(
*
* @codeGenApi
*/
export function ΔelementStylingApply(index: number): void {
export function ɵɵelementStylingApply(index: number): void {
elementStylingApplyInternal(DEFAULT_TEMPLATE_DIRECTIVE_INDEX, index);
}
@ -419,7 +419,7 @@ export function ΔelementStylingApply(index: number): void {
*
* @codeGenApi
*/
export function ΔelementHostStylingApply(): void {
export function ɵɵelementHostStylingApply(): void {
elementStylingApplyInternal(getActiveDirectiveStylingIndex(), getSelectedIndex());
}

View File

@ -24,7 +24,7 @@ import {createNodeAtIndex} from './shared';
*
* @codeGenApi
*/
export function Δtext(index: number, value?: any): void {
export function ɵɵtext(index: number, value?: any): void {
const lView = getLView();
ngDevMode && assertEqual(
lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,
@ -47,7 +47,7 @@ export function Δtext(index: number, value?: any): void {
*
* @codeGenApi
*/
export function ΔtextBinding<T>(index: number, value: T | NO_CHANGE): void {
export function ɵɵtextBinding<T>(index: number, value: T | NO_CHANGE): void {
if (value !== NO_CHANGE) {
const lView = getLView();
ngDevMode && assertDataInRange(lView, index + HEADER_OFFSET);

View File

@ -88,7 +88,7 @@ export interface PipeType<T> extends Type<T> { ngPipeDef: never; }
/**
* @codeGenApi
*/
export type ΔDirectiveDefWithMeta<
export type ɵɵDirectiveDefWithMeta<
T, Selector extends string, ExportAs extends string[], InputMap extends{[key: string]: string},
OutputMap extends{[key: string]: string}, QueryFields extends string[]> = DirectiveDef<T>;
@ -103,7 +103,7 @@ export type ΔDirectiveDefWithMeta<
*
* @codeGenApi
*/
export interface ΔBaseDef<T> {
export interface ɵɵBaseDef<T> {
/**
* A dictionary mapping the inputs' minified property names to their public API names, which
* are their aliases if any, or their original unminified property names
@ -139,7 +139,7 @@ export interface ΔBaseDef<T> {
*
* See: {@link defineDirective}
*/
export interface DirectiveDef<T> extends ΔBaseDef<T> {
export interface DirectiveDef<T> extends ɵɵBaseDef<T> {
/** Token representing the directive. Used by DI. */
type: Type<T>;
@ -202,7 +202,7 @@ export interface DirectiveDef<T> extends ΔBaseDef<T> {
/**
* @codeGenApi
*/
export type ΔComponentDefWithMeta<
export type ɵɵComponentDefWithMeta<
T, Selector extends String, ExportAs extends string[], InputMap extends{[key: string]: string},
OutputMap extends{[key: string]: string}, QueryFields extends string[]> = ComponentDef<T>;
@ -349,7 +349,7 @@ export interface PipeDef<T> {
/**
* @codeGenApi
*/
export type ΔPipeDefWithMeta<T, Name extends string> = PipeDef<T>;
export type ɵɵPipeDefWithMeta<T, Name extends string> = PipeDef<T>;
export interface DirectiveDefFeature {
<T>(directiveDef: DirectiveDef<T>): void;

View File

@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ΔdefineInjectable, ΔdefineInjector,} from '../../di/interface/defs';
import {Δinject} from '../../di/injector_compatibility';
import {ɵɵdefineInjectable, ɵɵdefineInjector,} from '../../di/interface/defs';
import {ɵɵinject} from '../../di/injector_compatibility';
import * as r3 from '../index';
import * as sanitization from '../../sanitization/sanitization';
@ -18,117 +18,117 @@ import * as sanitization from '../../sanitization/sanitization';
* This should be kept up to date with the public exports of @angular/core.
*/
export const angularCoreEnv: {[name: string]: Function} = {
'ΔdefineBase': r3.ΔdefineBase,
'ΔdefineComponent': r3.ΔdefineComponent,
'ΔdefineDirective': r3.ΔdefineDirective,
'ΔdefineInjectable': ΔdefineInjectable,
'ΔdefineInjector': ΔdefineInjector,
'ΔdefineNgModule': r3.ΔdefineNgModule,
'ΔdefinePipe': r3.ΔdefinePipe,
'ΔdirectiveInject': r3.ΔdirectiveInject,
'ΔgetFactoryOf': r3.ΔgetFactoryOf,
'ΔgetInheritedFactory': r3.ΔgetInheritedFactory,
'Δinject': Δinject,
'ΔinjectAttribute': r3.ΔinjectAttribute,
'ΔtemplateRefExtractor': r3.ΔtemplateRefExtractor,
'ΔNgOnChangesFeature': r3.ΔNgOnChangesFeature,
'ΔProvidersFeature': r3.ΔProvidersFeature,
'ΔInheritDefinitionFeature': r3.ΔInheritDefinitionFeature,
'ΔelementAttribute': r3.ΔelementAttribute,
'Δbind': r3.Δbind,
'Δcontainer': r3.Δcontainer,
'ΔnextContext': r3.ΔnextContext,
'ΔcontainerRefreshStart': r3.ΔcontainerRefreshStart,
'ΔcontainerRefreshEnd': r3.ΔcontainerRefreshEnd,
'ΔnamespaceHTML': r3.ΔnamespaceHTML,
'ΔnamespaceMathML': r3.ΔnamespaceMathML,
'ΔnamespaceSVG': r3.ΔnamespaceSVG,
'ΔenableBindings': r3.ΔenableBindings,
'ΔdisableBindings': r3.ΔdisableBindings,
'ΔallocHostVars': r3.ΔallocHostVars,
'ΔelementStart': r3.ΔelementStart,
'ΔelementEnd': r3.ΔelementEnd,
'Δelement': r3.Δelement,
'ΔelementContainerStart': r3.ΔelementContainerStart,
'ΔelementContainerEnd': r3.ΔelementContainerEnd,
'ΔpureFunction0': r3.ΔpureFunction0,
'ΔpureFunction1': r3.ΔpureFunction1,
'ΔpureFunction2': r3.ΔpureFunction2,
'ΔpureFunction3': r3.ΔpureFunction3,
'ΔpureFunction4': r3.ΔpureFunction4,
'ΔpureFunction5': r3.ΔpureFunction5,
'ΔpureFunction6': r3.ΔpureFunction6,
'ΔpureFunction7': r3.ΔpureFunction7,
'ΔpureFunction8': r3.ΔpureFunction8,
'ΔpureFunctionV': r3.ΔpureFunctionV,
'ΔgetCurrentView': r3.ΔgetCurrentView,
'ΔrestoreView': r3.ΔrestoreView,
'Δinterpolation1': r3.Δinterpolation1,
'Δinterpolation2': r3.Δinterpolation2,
'Δinterpolation3': r3.Δinterpolation3,
'Δinterpolation4': r3.Δinterpolation4,
'Δinterpolation5': r3.Δinterpolation5,
'Δinterpolation6': r3.Δinterpolation6,
'Δinterpolation7': r3.Δinterpolation7,
'Δinterpolation8': r3.Δinterpolation8,
'ΔinterpolationV': r3.ΔinterpolationV,
'Δlistener': r3.Δlistener,
'Δload': r3.Δload,
'Δprojection': r3.Δprojection,
'ΔelementProperty': r3.ΔelementProperty,
'ΔcomponentHostSyntheticProperty': r3.ΔcomponentHostSyntheticProperty,
'ΔcomponentHostSyntheticListener': r3.ΔcomponentHostSyntheticListener,
'ΔpipeBind1': r3.ΔpipeBind1,
'ΔpipeBind2': r3.ΔpipeBind2,
'ΔpipeBind3': r3.ΔpipeBind3,
'ΔpipeBind4': r3.ΔpipeBind4,
'ΔpipeBindV': r3.ΔpipeBindV,
'ΔprojectionDef': r3.ΔprojectionDef,
'Δpipe': r3.Δpipe,
'ΔqueryRefresh': r3.ΔqueryRefresh,
'ΔviewQuery': r3.ΔviewQuery,
'ΔstaticViewQuery': r3.ΔstaticViewQuery,
'ΔstaticContentQuery': r3.ΔstaticContentQuery,
'ΔloadViewQuery': r3.ΔloadViewQuery,
'ΔcontentQuery': r3.ΔcontentQuery,
'ΔloadContentQuery': r3.ΔloadContentQuery,
'Δreference': r3.Δreference,
'ΔelementHostAttrs': r3.ΔelementHostAttrs,
'ΔelementStyling': r3.ΔelementStyling,
'ΔelementStylingMap': r3.ΔelementStylingMap,
'ΔelementStyleProp': r3.ΔelementStyleProp,
'ΔelementStylingApply': r3.ΔelementStylingApply,
'ΔelementClassProp': r3.ΔelementClassProp,
'ΔelementHostStyling': r3.ΔelementHostStyling,
'ΔelementHostStylingMap': r3.ΔelementHostStylingMap,
'ΔelementHostStyleProp': r3.ΔelementHostStyleProp,
'ΔelementHostStylingApply': r3.ΔelementHostStylingApply,
'ΔelementHostClassProp': r3.ΔelementHostClassProp,
'Δselect': r3.Δselect,
'Δtemplate': r3.Δtemplate,
'Δtext': r3.Δtext,
'ΔtextBinding': r3.ΔtextBinding,
'ΔembeddedViewStart': r3.ΔembeddedViewStart,
'ΔembeddedViewEnd': r3.ΔembeddedViewEnd,
'Δi18n': r3.Δi18n,
'Δi18nAttributes': r3.Δi18nAttributes,
'Δi18nExp': r3.Δi18nExp,
'Δi18nStart': r3.Δi18nStart,
'Δi18nEnd': r3.Δi18nEnd,
'Δi18nApply': r3.Δi18nApply,
'Δi18nPostprocess': r3.Δi18nPostprocess,
'Δi18nLocalize': r3.Δi18nLocalize,
'ΔresolveWindow': r3.ΔresolveWindow,
'ΔresolveDocument': r3.ΔresolveDocument,
'ΔresolveBody': r3.ΔresolveBody,
'ΔsetComponentScope': r3.ΔsetComponentScope,
'ΔsetNgModuleScope': r3.ΔsetNgModuleScope,
'ɵɵdefineBase': r3.ɵɵdefineBase,
'ɵɵdefineComponent': r3.ɵɵdefineComponent,
'ɵɵdefineDirective': r3.ɵɵdefineDirective,
'ɵɵdefineInjectable': ɵɵdefineInjectable,
'ɵɵdefineInjector': ɵɵdefineInjector,
'ɵɵdefineNgModule': r3.ɵɵdefineNgModule,
'ɵɵdefinePipe': r3.ɵɵdefinePipe,
'ɵɵdirectiveInject': r3.ɵɵdirectiveInject,
'ɵɵgetFactoryOf': r3.ɵɵgetFactoryOf,
'ɵɵgetInheritedFactory': r3.ɵɵgetInheritedFactory,
'ɵɵinject': ɵɵinject,
'ɵɵinjectAttribute': r3.ɵɵinjectAttribute,
'ɵɵtemplateRefExtractor': r3.ɵɵtemplateRefExtractor,
'ɵɵNgOnChangesFeature': r3.ɵɵNgOnChangesFeature,
'ɵɵProvidersFeature': r3.ɵɵProvidersFeature,
'ɵɵInheritDefinitionFeature': r3.ɵɵInheritDefinitionFeature,
'ɵɵelementAttribute': r3.ɵɵelementAttribute,
'ɵɵbind': r3.ɵɵbind,
'ɵɵcontainer': r3.ɵɵcontainer,
'ɵɵnextContext': r3.ɵɵnextContext,
'ɵɵcontainerRefreshStart': r3.ɵɵcontainerRefreshStart,
'ɵɵcontainerRefreshEnd': r3.ɵɵcontainerRefreshEnd,
'ɵɵnamespaceHTML': r3.ɵɵnamespaceHTML,
'ɵɵnamespaceMathML': r3.ɵɵnamespaceMathML,
'ɵɵnamespaceSVG': r3.ɵɵnamespaceSVG,
'ɵɵenableBindings': r3.ɵɵenableBindings,
'ɵɵdisableBindings': r3.ɵɵdisableBindings,
'ɵɵallocHostVars': r3.ɵɵallocHostVars,
'ɵɵelementStart': r3.ɵɵelementStart,
'ɵɵelementEnd': r3.ɵɵelementEnd,
'ɵɵelement': r3.ɵɵelement,
'ɵɵelementContainerStart': r3.ɵɵelementContainerStart,
'ɵɵelementContainerEnd': r3.ɵɵelementContainerEnd,
'ɵɵpureFunction0': r3.ɵɵpureFunction0,
'ɵɵpureFunction1': r3.ɵɵpureFunction1,
'ɵɵpureFunction2': r3.ɵɵpureFunction2,
'ɵɵpureFunction3': r3.ɵɵpureFunction3,
'ɵɵpureFunction4': r3.ɵɵpureFunction4,
'ɵɵpureFunction5': r3.ɵɵpureFunction5,
'ɵɵpureFunction6': r3.ɵɵpureFunction6,
'ɵɵpureFunction7': r3.ɵɵpureFunction7,
'ɵɵpureFunction8': r3.ɵɵpureFunction8,
'ɵɵpureFunctionV': r3.ɵɵpureFunctionV,
'ɵɵgetCurrentView': r3.ɵɵgetCurrentView,
'ɵɵrestoreView': r3.ɵɵrestoreView,
'ɵɵinterpolation1': r3.ɵɵinterpolation1,
'ɵɵinterpolation2': r3.ɵɵinterpolation2,
'ɵɵinterpolation3': r3.ɵɵinterpolation3,
'ɵɵinterpolation4': r3.ɵɵinterpolation4,
'ɵɵinterpolation5': r3.ɵɵinterpolation5,
'ɵɵinterpolation6': r3.ɵɵinterpolation6,
'ɵɵinterpolation7': r3.ɵɵinterpolation7,
'ɵɵinterpolation8': r3.ɵɵinterpolation8,
'ɵɵinterpolationV': r3.ɵɵinterpolationV,
'ɵɵlistener': r3.ɵɵlistener,
'ɵɵload': r3.ɵɵload,
'ɵɵprojection': r3.ɵɵprojection,
'ɵɵelementProperty': r3.ɵɵelementProperty,
'ɵɵcomponentHostSyntheticProperty': r3.ɵɵcomponentHostSyntheticProperty,
'ɵɵcomponentHostSyntheticListener': r3.ɵɵcomponentHostSyntheticListener,
'ɵɵpipeBind1': r3.ɵɵpipeBind1,
'ɵɵpipeBind2': r3.ɵɵpipeBind2,
'ɵɵpipeBind3': r3.ɵɵpipeBind3,
'ɵɵpipeBind4': r3.ɵɵpipeBind4,
'ɵɵpipeBindV': r3.ɵɵpipeBindV,
'ɵɵprojectionDef': r3.ɵɵprojectionDef,
'ɵɵpipe': r3.ɵɵpipe,
'ɵɵqueryRefresh': r3.ɵɵqueryRefresh,
'ɵɵviewQuery': r3.ɵɵviewQuery,
'ɵɵstaticViewQuery': r3.ɵɵstaticViewQuery,
'ɵɵstaticContentQuery': r3.ɵɵstaticContentQuery,
'ɵɵloadViewQuery': r3.ɵɵloadViewQuery,
'ɵɵcontentQuery': r3.ɵɵcontentQuery,
'ɵɵloadContentQuery': r3.ɵɵloadContentQuery,
'ɵɵreference': r3.ɵɵreference,
'ɵɵelementHostAttrs': r3.ɵɵelementHostAttrs,
'ɵɵelementStyling': r3.ɵɵelementStyling,
'ɵɵelementStylingMap': r3.ɵɵelementStylingMap,
'ɵɵelementStyleProp': r3.ɵɵelementStyleProp,
'ɵɵelementStylingApply': r3.ɵɵelementStylingApply,
'ɵɵelementClassProp': r3.ɵɵelementClassProp,
'ɵɵelementHostStyling': r3.ɵɵelementHostStyling,
'ɵɵelementHostStylingMap': r3.ɵɵelementHostStylingMap,
'ɵɵelementHostStyleProp': r3.ɵɵelementHostStyleProp,
'ɵɵelementHostStylingApply': r3.ɵɵelementHostStylingApply,
'ɵɵelementHostClassProp': r3.ɵɵelementHostClassProp,
'ɵɵselect': r3.ɵɵselect,
'ɵɵtemplate': r3.ɵɵtemplate,
'ɵɵtext': r3.ɵɵtext,
'ɵɵtextBinding': r3.ɵɵtextBinding,
'ɵɵembeddedViewStart': r3.ɵɵembeddedViewStart,
'ɵɵembeddedViewEnd': r3.ɵɵembeddedViewEnd,
'ɵɵi18n': r3.ɵɵi18n,
'ɵɵi18nAttributes': r3.ɵɵi18nAttributes,
'ɵɵi18nExp': r3.ɵɵi18nExp,
'ɵɵi18nStart': r3.ɵɵi18nStart,
'ɵɵi18nEnd': r3.ɵɵi18nEnd,
'ɵɵi18nApply': r3.ɵɵi18nApply,
'ɵɵi18nPostprocess': r3.ɵɵi18nPostprocess,
'ɵɵi18nLocalize': r3.ɵɵi18nLocalize,
'ɵɵresolveWindow': r3.ɵɵresolveWindow,
'ɵɵresolveDocument': r3.ɵɵresolveDocument,
'ɵɵresolveBody': r3.ɵɵresolveBody,
'ɵɵsetComponentScope': r3.ɵɵsetComponentScope,
'ɵɵsetNgModuleScope': r3.ɵɵsetNgModuleScope,
'ΔsanitizeHtml': sanitization.ΔsanitizeHtml,
'ΔsanitizeStyle': sanitization.ΔsanitizeStyle,
'ΔdefaultStyleSanitizer': sanitization.ΔdefaultStyleSanitizer,
'ΔsanitizeResourceUrl': sanitization.ΔsanitizeResourceUrl,
'ΔsanitizeScript': sanitization.ΔsanitizeScript,
'ΔsanitizeUrl': sanitization.ΔsanitizeUrl,
'ΔsanitizeUrlOrResourceUrl': sanitization.ΔsanitizeUrlOrResourceUrl
'ɵɵsanitizeHtml': sanitization.ɵɵsanitizeHtml,
'ɵɵsanitizeStyle': sanitization.ɵɵsanitizeStyle,
'ɵɵdefaultStyleSanitizer': sanitization.ɵɵdefaultStyleSanitizer,
'ɵɵsanitizeResourceUrl': sanitization.ɵɵsanitizeResourceUrl,
'ɵɵsanitizeScript': sanitization.ɵɵsanitizeScript,
'ɵɵsanitizeUrl': sanitization.ɵɵsanitizeUrl,
'ɵɵsanitizeUrlOrResourceUrl': sanitization.ɵɵsanitizeUrlOrResourceUrl
};

View File

@ -9,10 +9,10 @@
import {WrappedValue} from '../change_detection/change_detection_util';
import {PipeTransform} from '../change_detection/pipe_transform';
import {store, Δload} from './instructions/all';
import {store, ɵɵload} from './instructions/all';
import {PipeDef, PipeDefList} from './interfaces/definition';
import {BINDING_INDEX, HEADER_OFFSET, TVIEW} from './interfaces/view';
import {ΔpureFunction1, ΔpureFunction2, ΔpureFunction3, ΔpureFunction4, ΔpureFunctionV} from './pure_function';
import {ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunctionV} from './pure_function';
import {getLView} from './state';
import {NO_CHANGE} from './tokens';
@ -27,7 +27,7 @@ import {NO_CHANGE} from './tokens';
*
* @codeGenApi
*/
export function Δpipe(index: number, pipeName: string): any {
export function ɵɵpipe(index: number, pipeName: string): any {
const tView = getLView()[TVIEW];
let pipeDef: PipeDef<any>;
const adjustedIndex = index + HEADER_OFFSET;
@ -81,10 +81,10 @@ function getPipeDef(name: string, registry: PipeDefList | null): PipeDef<any> {
*
* @codeGenApi
*/
export function ΔpipeBind1(index: number, slotOffset: number, v1: any): any {
const pipeInstance = Δload<PipeTransform>(index);
export function ɵɵpipeBind1(index: number, slotOffset: number, v1: any): any {
const pipeInstance = ɵɵload<PipeTransform>(index);
return unwrapValue(
isPure(index) ? ΔpureFunction1(slotOffset, pipeInstance.transform, v1, pipeInstance) :
isPure(index) ? ɵɵpureFunction1(slotOffset, pipeInstance.transform, v1, pipeInstance) :
pipeInstance.transform(v1));
}
@ -101,10 +101,10 @@ export function ΔpipeBind1(index: number, slotOffset: number, v1: any): any {
*
* @codeGenApi
*/
export function ΔpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any {
const pipeInstance = Δload<PipeTransform>(index);
export function ɵɵpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any {
const pipeInstance = ɵɵload<PipeTransform>(index);
return unwrapValue(
isPure(index) ? ΔpureFunction2(slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :
isPure(index) ? ɵɵpureFunction2(slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :
pipeInstance.transform(v1, v2));
}
@ -122,11 +122,12 @@ export function ΔpipeBind2(index: number, slotOffset: number, v1: any, v2: any)
*
* @codeGenApi
*/
export function ΔpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any {
const pipeInstance = Δload<PipeTransform>(index);
export function ɵɵpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any {
const pipeInstance = ɵɵload<PipeTransform>(index);
return unwrapValue(
isPure(index) ? ΔpureFunction3(slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :
pipeInstance.transform(v1, v2, v3));
isPure(index) ?
ɵɵpureFunction3(slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :
pipeInstance.transform(v1, v2, v3));
}
/**
@ -144,12 +145,12 @@ export function ΔpipeBind3(index: number, slotOffset: number, v1: any, v2: any,
*
* @codeGenApi
*/
export function ΔpipeBind4(
export function ɵɵpipeBind4(
index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any {
const pipeInstance = Δload<PipeTransform>(index);
const pipeInstance = ɵɵload<PipeTransform>(index);
return unwrapValue(
isPure(index) ?
ΔpureFunction4(slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :
ɵɵpureFunction4(slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :
pipeInstance.transform(v1, v2, v3, v4));
}
@ -165,10 +166,10 @@ export function ΔpipeBind4(
*
* @codeGenApi
*/
export function ΔpipeBindV(index: number, slotOffset: number, values: any[]): any {
const pipeInstance = Δload<PipeTransform>(index);
export function ɵɵpipeBindV(index: number, slotOffset: number, values: any[]): any {
const pipeInstance = ɵɵload<PipeTransform>(index);
return unwrapValue(
isPure(index) ? ΔpureFunctionV(slotOffset, pipeInstance.transform, values, pipeInstance) :
isPure(index) ? ɵɵpureFunctionV(slotOffset, pipeInstance.transform, values, pipeInstance) :
pipeInstance.transform.apply(pipeInstance, values));
}

View File

@ -40,7 +40,7 @@ import {getBindingRoot, getLView, isCreationMode} from './state';
*
* @codeGenApi
*/
export function ΔpureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T {
export function ɵɵpureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
const bindingIndex = getBindingRoot() + slotOffset;
const lView = getLView();
@ -61,7 +61,7 @@ export function ΔpureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?
*
* @codeGenApi
*/
export function ΔpureFunction1(
export function ɵɵpureFunction1(
slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
const lView = getLView();
@ -84,7 +84,7 @@ export function ΔpureFunction1(
*
* @codeGenApi
*/
export function ΔpureFunction2(
export function ɵɵpureFunction2(
slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any,
thisArg?: any): any {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
@ -111,7 +111,7 @@ export function ΔpureFunction2(
*
* @codeGenApi
*/
export function ΔpureFunction3(
export function ɵɵpureFunction3(
slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any,
thisArg?: any): any {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
@ -139,7 +139,7 @@ export function ΔpureFunction3(
*
* @codeGenApi
*/
export function ΔpureFunction4(
export function ɵɵpureFunction4(
slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any,
exp3: any, exp4: any, thisArg?: any): any {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
@ -168,7 +168,7 @@ export function ΔpureFunction4(
*
* @codeGenApi
*/
export function ΔpureFunction5(
export function ɵɵpureFunction5(
slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any,
exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
@ -199,7 +199,7 @@ export function ΔpureFunction5(
*
* @codeGenApi
*/
export function ΔpureFunction6(
export function ɵɵpureFunction6(
slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any,
exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
@ -232,7 +232,7 @@ export function ΔpureFunction6(
*
* @codeGenApi
*/
export function ΔpureFunction7(
export function ɵɵpureFunction7(
slotOffset: number,
pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any,
exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any {
@ -267,7 +267,7 @@ export function ΔpureFunction7(
*
* @codeGenApi
*/
export function ΔpureFunction8(
export function ɵɵpureFunction8(
slotOffset: number,
pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any,
exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any,
@ -299,7 +299,7 @@ export function ΔpureFunction8(
*
* @codeGenApi
*/
export function ΔpureFunctionV(
export function ɵɵpureFunctionV(
slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any {
// TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings
let bindingIndex = getBindingRoot() + slotOffset;

View File

@ -18,7 +18,7 @@ import {assertDataInRange, assertDefined, assertEqual} from '../util/assert';
import {assertPreviousIsParent} from './assert';
import {getNodeInjectable, locateDirectiveOrProvider} from './di';
import {NG_ELEMENT_ID} from './fields';
import {store, Δload} from './instructions/all';
import {store, ɵɵload} from './instructions/all';
import {storeCleanupWithContext} from './instructions/shared';
import {unusedValueExportToPlacateAjd as unused1} from './interfaces/definition';
import {unusedValueExportToPlacateAjd as unused2} from './interfaces/injector';
@ -372,7 +372,7 @@ export function query<T>(
*
* @codeGenApi
*/
export function ΔqueryRefresh(queryList: QueryList<any>): boolean {
export function ɵɵqueryRefresh(queryList: QueryList<any>): boolean {
const queryListImpl = (queryList as any as QueryList_<any>);
const creationMode = isCreationMode();
@ -394,10 +394,10 @@ export function ΔqueryRefresh(queryList: QueryList<any>): boolean {
*
* @codeGenApi
*/
export function ΔstaticViewQuery<T>(
export function ɵɵstaticViewQuery<T>(
// TODO(FW-486): "read" should be an AbstractType
predicate: Type<any>| string[], descend: boolean, read: any): void {
const queryList = ΔviewQuery(predicate, descend, read) as QueryList_<T>;
const queryList = ɵɵviewQuery(predicate, descend, read) as QueryList_<T>;
const tView = getLView()[TVIEW];
queryList._static = true;
if (!tView.staticViewQueries) {
@ -415,7 +415,7 @@ export function ΔstaticViewQuery<T>(
*
* @codeGenApi
*/
export function ΔviewQuery<T>(
export function ɵɵviewQuery<T>(
// TODO(FW-486): "read" should be an AbstractType
predicate: Type<any>| string[], descend: boolean, read: any): QueryList<T> {
const lView = getLView();
@ -435,10 +435,10 @@ export function ΔviewQuery<T>(
*
* @codeGenApi
*/
export function ΔloadViewQuery<T>(): T {
export function ɵɵloadViewQuery<T>(): T {
const index = getCurrentQueryIndex();
setCurrentQueryIndex(index + 1);
return Δload<T>(index - HEADER_OFFSET);
return ɵɵload<T>(index - HEADER_OFFSET);
}
/**
@ -453,7 +453,7 @@ export function ΔloadViewQuery<T>(): T {
*
* @codeGenApi
*/
export function ΔcontentQuery<T>(
export function ɵɵcontentQuery<T>(
directiveIndex: number, predicate: Type<any>| string[], descend: boolean,
// TODO(FW-486): "read" should be an AbstractType
read: any): QueryList<T> {
@ -484,11 +484,11 @@ export function ΔcontentQuery<T>(
*
* @codeGenApi
*/
export function ΔstaticContentQuery<T>(
export function ɵɵstaticContentQuery<T>(
directiveIndex: number, predicate: Type<any>| string[], descend: boolean,
// TODO(FW-486): "read" should be an AbstractType
read: any): void {
const queryList = ΔcontentQuery(directiveIndex, predicate, descend, read) as QueryList_<T>;
const queryList = ɵɵcontentQuery(directiveIndex, predicate, descend, read) as QueryList_<T>;
const tView = getLView()[TVIEW];
queryList._static = true;
if (!tView.staticContentQueries) {
@ -500,7 +500,7 @@ export function ΔstaticContentQuery<T>(
*
* @codeGenApi
*/
export function ΔloadContentQuery<T>(): QueryList<T> {
export function ɵɵloadContentQuery<T>(): QueryList<T> {
const lView = getLView();
ngDevMode &&
assertDefined(

View File

@ -82,17 +82,17 @@ export function getBindingsEnabled(): boolean {
* Should match component / directive.
* </my-comp>
* <div ngNonBindable>
* <!-- ΔdisableBindings() -->
* <!-- ɵɵdisableBindings() -->
* <my-comp my-directive>
* Should not match component / directive because we are in ngNonBindable.
* </my-comp>
* <!-- ΔenableBindings() -->
* <!-- ɵɵenableBindings() -->
* </div>
* ```
*
* @codeGenApi
*/
export function ΔenableBindings(): void {
export function ɵɵenableBindings(): void {
bindingsEnabled = true;
}
@ -105,17 +105,17 @@ export function ΔenableBindings(): void {
* Should match component / directive.
* </my-comp>
* <div ngNonBindable>
* <!-- ΔdisableBindings() -->
* <!-- ɵɵdisableBindings() -->
* <my-comp my-directive>
* Should not match component / directive because we are in ngNonBindable.
* </my-comp>
* <!-- ΔenableBindings() -->
* <!-- ɵɵenableBindings() -->
* </div>
* ```
*
* @codeGenApi
*/
export function ΔdisableBindings(): void {
export function ɵɵdisableBindings(): void {
bindingsEnabled = false;
}
@ -269,7 +269,7 @@ export function getActiveDirectiveSuperClassDepth() {
*
* @codeGenApi
*/
export function ΔrestoreView(viewToRestore: OpaqueViewState) {
export function ɵɵrestoreView(viewToRestore: OpaqueViewState) {
contextLView = viewToRestore as any as LView;
}
@ -492,7 +492,7 @@ let _currentNamespace: string|null = null;
*
* @codeGenApi
*/
export function ΔnamespaceSVG() {
export function ɵɵnamespaceSVG() {
_currentNamespace = 'http://www.w3.org/2000/svg';
}
@ -501,7 +501,7 @@ export function ΔnamespaceSVG() {
*
* @codeGenApi
*/
export function ΔnamespaceMathML() {
export function ɵɵnamespaceMathML() {
_currentNamespace = 'http://www.w3.org/1998/MathML/';
}
@ -511,7 +511,7 @@ export function ΔnamespaceMathML() {
*
* @codeGenApi
*/
export function ΔnamespaceHTML() {
export function ɵɵnamespaceHTML() {
_currentNamespace = null;
}

View File

@ -45,7 +45,7 @@ export const defaultScheduler =
*
* @codeGenApi
*/
export function ΔresolveWindow(element: RElement & {ownerDocument: Document}) {
export function ɵɵresolveWindow(element: RElement & {ownerDocument: Document}) {
return {name: 'window', target: element.ownerDocument.defaultView};
}
@ -53,7 +53,7 @@ export function ΔresolveWindow(element: RElement & {ownerDocument: Document}) {
*
* @codeGenApi
*/
export function ΔresolveDocument(element: RElement & {ownerDocument: Document}) {
export function ɵɵresolveDocument(element: RElement & {ownerDocument: Document}) {
return {name: 'document', target: element.ownerDocument};
}
@ -61,7 +61,7 @@ export function ΔresolveDocument(element: RElement & {ownerDocument: Document})
*
* @codeGenApi
*/
export function ΔresolveBody(element: RElement & {ownerDocument: Document}) {
export function ɵɵresolveBody(element: RElement & {ownerDocument: Document}) {
return {name: 'body', target: element.ownerDocument.body};
}

View File

@ -22,6 +22,6 @@ import {createTemplateRef} from './view_engine_compatibility';
*
* @codeGenApi
*/
export function ΔtemplateRefExtractor(tNode: TNode, currentView: LView) {
export function ɵɵtemplateRefExtractor(tNode: TNode, currentView: LView) {
return createTemplateRef(ViewEngine_TemplateRef, ViewEngine_ElementRef, tNode, currentView);
}

View File

@ -33,7 +33,7 @@ import {_sanitizeUrl as _sanitizeUrl} from './url_sanitizer';
*
* @publicApi
*/
export function ΔsanitizeHtml(unsafeHtml: any): string {
export function ɵɵsanitizeHtml(unsafeHtml: any): string {
const sanitizer = getSanitizer();
if (sanitizer) {
return sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '';
@ -59,7 +59,7 @@ export function ΔsanitizeHtml(unsafeHtml: any): string {
*
* @publicApi
*/
export function ΔsanitizeStyle(unsafeStyle: any): string {
export function ɵɵsanitizeStyle(unsafeStyle: any): string {
const sanitizer = getSanitizer();
if (sanitizer) {
return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';
@ -86,7 +86,7 @@ export function ΔsanitizeStyle(unsafeStyle: any): string {
*
* @publicApi
*/
export function ΔsanitizeUrl(unsafeUrl: any): string {
export function ɵɵsanitizeUrl(unsafeUrl: any): string {
const sanitizer = getSanitizer();
if (sanitizer) {
return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';
@ -108,7 +108,7 @@ export function ΔsanitizeUrl(unsafeUrl: any): string {
*
* @publicApi
*/
export function ΔsanitizeResourceUrl(unsafeResourceUrl: any): string {
export function ɵɵsanitizeResourceUrl(unsafeResourceUrl: any): string {
const sanitizer = getSanitizer();
if (sanitizer) {
return sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '';
@ -131,7 +131,7 @@ export function ΔsanitizeResourceUrl(unsafeResourceUrl: any): string {
*
* @publicApi
*/
export function ΔsanitizeScript(unsafeScript: any): string {
export function ɵɵsanitizeScript(unsafeScript: any): string {
const sanitizer = getSanitizer();
if (sanitizer) {
return sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '';
@ -153,9 +153,9 @@ export function getUrlSanitizer(tag: string, prop: string) {
if ((prop === 'src' && (tag === 'embed' || tag === 'frame' || tag === 'iframe' ||
tag === 'media' || tag === 'script')) ||
(prop === 'href' && (tag === 'base' || tag === 'link'))) {
return ΔsanitizeResourceUrl;
return ɵɵsanitizeResourceUrl;
}
return ΔsanitizeUrl;
return ɵɵsanitizeUrl;
}
/**
@ -173,7 +173,7 @@ export function getUrlSanitizer(tag: string, prop: string) {
*
* @publicApi
*/
export function ΔsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any {
export function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any {
return getUrlSanitizer(tag, prop)(unsafeUrl);
}
@ -183,13 +183,13 @@ export function ΔsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: st
*
* @publicApi
*/
export const ΔdefaultStyleSanitizer = (function(prop: string, value?: string): string | boolean {
export const ɵɵdefaultStyleSanitizer = (function(prop: string, value?: string): string | boolean {
if (value === undefined) {
return prop === 'background-image' || prop === 'background' || prop === 'border-image' ||
prop === 'filter' || prop === 'list-style' || prop === 'list-style-image';
}
return ΔsanitizeStyle(value);
return ɵɵsanitizeStyle(value);
} as StyleSanitizeFn);
export function validateAgainstEventProperties(name: string) {

View File

@ -9,7 +9,7 @@
import {resolveForwardRef} from '../di/forward_ref';
import {INJECTOR, Injector} from '../di/injector';
import {setCurrentInjector} from '../di/injector_compatibility';
import {getInjectableDef, ΔInjectableDef} from '../di/interface/defs';
import {getInjectableDef, ɵɵInjectableDef} from '../di/interface/defs';
import {APP_ROOT} from '../di/scope';
import {NgModuleRef} from '../linker/ng_module_factory';
import {stringify} from '../util/stringify';
@ -98,7 +98,7 @@ export function resolveNgModuleDep(
return data;
}
const providerDef = data._def.providersByKey[tokenKey];
let injectableDef: ΔInjectableDef<any>|null;
let injectableDef: ɵɵInjectableDef<any>|null;
if (providerDef) {
let providerInstance = data._providers[providerDef.index];
if (providerInstance === undefined) {
@ -132,7 +132,7 @@ function moduleTransitivelyPresent(ngModule: NgModuleData, scope: any): boolean
return ngModule._def.modules.indexOf(scope) > -1;
}
function targetsModule(ngModule: NgModuleData, def: ΔInjectableDef<any>): boolean {
function targetsModule(ngModule: NgModuleData, def: ɵɵInjectableDef<any>): boolean {
return def.providedIn != null && (moduleTransitivelyPresent(ngModule, def.providedIn) ||
def.providedIn === 'root' && ngModule._def.isRoot);
}

View File

@ -9,7 +9,7 @@
import {DebugElement__PRE_R3__, DebugNode__PRE_R3__, EventListener, getDebugNode, indexDebugNode, removeDebugNodeFromIndex} from '../debug/debug_node';
import {Injector} from '../di';
import {InjectableType} from '../di/injectable';
import {getInjectableDef, ΔInjectableDef} from '../di/interface/defs';
import {getInjectableDef, ɵɵInjectableDef} from '../di/interface/defs';
import {ErrorHandler} from '../error_handler';
import {Type} from '../interface/type';
import {ComponentFactory} from '../linker/component_factory';
@ -170,7 +170,7 @@ const viewDefOverrides = new Map<any, ViewDefinition>();
function debugOverrideProvider(override: ProviderOverride) {
providerOverrides.set(override.token, override);
let injectableDef: ΔInjectableDef<any>|null;
let injectableDef: ɵɵInjectableDef<any>|null;
if (typeof override.token === 'function' && (injectableDef = getInjectableDef(override.token)) &&
typeof injectableDef.providedIn === 'function') {
providerOverridesWithScope.set(override.token as InjectableType<any>, override);

View File

@ -675,30 +675,30 @@
"name": "viewAttachedToChangeDetector"
},
{
"name": "ΔdefineComponent"
"name": "ɵɵdefineComponent"
},
{
"name": "ΔdefineInjector"
"name": "ɵɵdefineInjector"
},
{
"name": "ΔdefineNgModule"
"name": "ɵɵdefineNgModule"
},
{
"name": "Δelement"
"name": "ɵɵelement"
},
{
"name": "ΔelementEnd"
"name": "ɵɵelementEnd"
},
{
"name": "ΔelementStart"
"name": "ɵɵelementStart"
},
{
"name": "ΔnamespaceHTML"
"name": "ɵɵnamespaceHTML"
},
{
"name": "ΔsetComponentScope"
"name": "ɵɵsetComponentScope"
},
{
"name": "Δtext"
"name": "ɵɵtext"
}
]

View File

@ -486,12 +486,12 @@
"name": "viewAttachedToChangeDetector"
},
{
"name": "ΔdefineComponent"
"name": "ɵɵdefineComponent"
},
{
"name": "ΔnamespaceHTML"
"name": "ɵɵnamespaceHTML"
},
{
"name": "Δtext"
"name": "ɵɵtext"
}
]

View File

@ -228,12 +228,12 @@
"name": "tryResolveToken"
},
{
"name": "ΔdefineInjectable"
"name": "ɵɵdefineInjectable"
},
{
"name": "ΔdefineInjector"
"name": "ɵɵdefineInjector"
},
{
"name": "Δinject"
"name": "ɵɵinject"
}
]

View File

@ -6,17 +6,17 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Injector, ɵcreateInjector as createInjector, ΔdefineInjectable, ΔdefineInjector} from '@angular/core';
import {Injector, ɵcreateInjector as createInjector, ɵɵdefineInjectable, ɵɵdefineInjector} from '@angular/core';
export class RootService {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: 'root',
factory: () => new RootService(),
});
}
export class ScopedService {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new ScopedService(),
});
@ -28,7 +28,7 @@ export class ScopedService {
}
export class DefinedInjector {
static ngInjectorDef = ΔdefineInjector({
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new DefinedInjector(),
providers: [ScopedService],
});

View File

@ -1305,69 +1305,69 @@
"name": "wrapListener"
},
{
"name": "Δbind"
"name": "ɵɵbind"
},
{
"name": "ΔdefineComponent"
"name": "ɵɵdefineComponent"
},
{
"name": "ΔdefineDirective"
"name": "ɵɵdefineDirective"
},
{
"name": "ΔdefineInjectable"
"name": "ɵɵdefineInjectable"
},
{
"name": "ΔdirectiveInject"
"name": "ɵɵdirectiveInject"
},
{
"name": "ΔelementClassProp"
"name": "ɵɵelementClassProp"
},
{
"name": "ΔelementEnd"
"name": "ɵɵelementEnd"
},
{
"name": "ΔelementProperty"
"name": "ɵɵelementProperty"
},
{
"name": "ΔelementStart"
"name": "ɵɵelementStart"
},
{
"name": "ΔelementStyling"
"name": "ɵɵelementStyling"
},
{
"name": "ΔelementStylingApply"
"name": "ɵɵelementStylingApply"
},
{
"name": "ΔgetCurrentView"
"name": "ɵɵgetCurrentView"
},
{
"name": "Δinterpolation1"
"name": "ɵɵinterpolation1"
},
{
"name": "Δlistener"
"name": "ɵɵlistener"
},
{
"name": "ΔnamespaceHTML"
"name": "ɵɵnamespaceHTML"
},
{
"name": "ΔnextContext"
"name": "ɵɵnextContext"
},
{
"name": "Δreference"
"name": "ɵɵreference"
},
{
"name": "ΔrestoreView"
"name": "ɵɵrestoreView"
},
{
"name": "Δselect"
"name": "ɵɵselect"
},
{
"name": "Δtemplate"
"name": "ɵɵtemplate"
},
{
"name": "Δtext"
"name": "ɵɵtext"
},
{
"name": "ΔtextBinding"
"name": "ɵɵtextBinding"
}
]

View File

@ -16,7 +16,7 @@ import '@angular/core/test/bundling/util/src/reflect_metadata';
*/
import './translations';
import {CommonModule} from '@angular/common';
import {Component, Injectable, NgModule, ViewEncapsulation, ɵmarkDirty as markDirty, ɵrenderComponent as renderComponent, Δi18nLocalize as localize} from '@angular/core';
import {Component, Injectable, NgModule, ViewEncapsulation, ɵmarkDirty as markDirty, ɵrenderComponent as renderComponent, ɵɵi18nLocalize as localize} from '@angular/core';
class Todo {
editing: boolean;

View File

@ -6,34 +6,34 @@
* found in the LICENSE file at https://angular.io/license
*/
import {INJECTOR, InjectFlags, InjectionToken, Injector, Optional, ΔdefineInjectable, ΔdefineInjector, Δinject} from '@angular/core';
import {INJECTOR, InjectFlags, InjectionToken, Injector, Optional, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵinject} from '@angular/core';
import {R3Injector, createInjector} from '@angular/core/src/di/r3_injector';
import {expect} from '@angular/platform-browser/testing/src/matchers';
describe('InjectorDef-based createInjector()', () => {
class CircularA {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => Δinject(CircularB),
factory: () => ɵɵinject(CircularB),
});
}
class CircularB {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => Δinject(CircularA),
factory: () => ɵɵinject(CircularA),
});
}
class Service {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new Service(),
});
}
class OptionalService {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new OptionalService(),
});
@ -55,41 +55,41 @@ describe('InjectorDef-based createInjector()', () => {
class ServiceWithDep {
constructor(readonly service: Service) {}
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new ServiceWithDep(Δinject(Service)),
factory: () => new ServiceWithDep(ɵɵinject(Service)),
});
}
class ServiceWithOptionalDep {
constructor(@Optional() readonly service: OptionalService|null) {}
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new ServiceWithOptionalDep(Δinject(OptionalService, InjectFlags.Optional)),
factory: () => new ServiceWithOptionalDep(ɵɵinject(OptionalService, InjectFlags.Optional)),
});
}
class ServiceWithMissingDep {
constructor(readonly service: Service) {}
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new ServiceWithMissingDep(Δinject(Service)),
factory: () => new ServiceWithMissingDep(ɵɵinject(Service)),
});
}
class ServiceWithMultiDep {
constructor(readonly locale: string[]) {}
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new ServiceWithMultiDep(Δinject(LOCALE)),
factory: () => new ServiceWithMultiDep(ɵɵinject(LOCALE)),
});
}
class ServiceTwo {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new ServiceTwo(),
});
@ -97,7 +97,7 @@ describe('InjectorDef-based createInjector()', () => {
let deepServiceDestroyed = false;
class DeepService {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: null,
factory: () => new DeepService(),
});
@ -107,7 +107,7 @@ describe('InjectorDef-based createInjector()', () => {
let eagerServiceCreated: boolean = false;
class EagerService {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: undefined,
factory: () => new EagerService(),
});
@ -119,8 +119,8 @@ describe('InjectorDef-based createInjector()', () => {
class DeepModule {
constructor(eagerService: EagerService) { deepModuleCreated = true; }
static ngInjectorDef = ΔdefineInjector({
factory: () => new DeepModule(Δinject(EagerService)),
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new DeepModule(ɵɵinject(EagerService)),
imports: undefined,
providers: [
EagerService,
@ -137,7 +137,7 @@ describe('InjectorDef-based createInjector()', () => {
}
class IntermediateModule {
static ngInjectorDef = ΔdefineInjector({
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new IntermediateModule(),
imports: [DeepModule.safe()],
providers: [],
@ -147,13 +147,13 @@ describe('InjectorDef-based createInjector()', () => {
class InjectorWithDep {
constructor(readonly service: Service) {}
static ngInjectorDef = ΔdefineInjector({
factory: () => new InjectorWithDep(Δinject(Service)),
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new InjectorWithDep(ɵɵinject(Service)),
});
}
class Module {
static ngInjectorDef = ΔdefineInjector({
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new Module(),
imports: [IntermediateModule],
providers: [
@ -175,7 +175,7 @@ describe('InjectorDef-based createInjector()', () => {
}
class OtherModule {
static ngInjectorDef = ΔdefineInjector({
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new OtherModule(),
imports: undefined,
providers: [],
@ -183,7 +183,7 @@ describe('InjectorDef-based createInjector()', () => {
}
class ModuleWithMissingDep {
static ngInjectorDef = ΔdefineInjector({
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new ModuleWithMissingDep(),
imports: undefined,
providers: [ServiceWithMissingDep],
@ -193,7 +193,7 @@ describe('InjectorDef-based createInjector()', () => {
class NotAModule {}
class ImportsNotAModule {
static ngInjectorDef = ΔdefineInjector({
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new ImportsNotAModule(),
imports: [NotAModule],
providers: [],
@ -202,7 +202,7 @@ describe('InjectorDef-based createInjector()', () => {
let scopedServiceDestroyed = false;
class ScopedService {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: Module,
factory: () => new ScopedService(),
});
@ -211,7 +211,7 @@ describe('InjectorDef-based createInjector()', () => {
}
class WrongScopeService {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: OtherModule,
factory: () => new WrongScopeService(),
});
@ -367,7 +367,7 @@ describe('InjectorDef-based createInjector()', () => {
}
class ErrorModule {
static ngInjectorDef =
ΔdefineInjector({factory: () => new ErrorModule(), providers: [MissingArgumentType]});
ɵɵdefineInjector({factory: () => new ErrorModule(), providers: [MissingArgumentType]});
}
expect(() => createInjector(ErrorModule).get(MissingArgumentType))
.toThrowError('Can\'t resolve all parameters for MissingArgumentType: (?).');

View File

@ -8,7 +8,7 @@
import {ANALYZE_FOR_ENTRY_COMPONENTS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectorRef, Compiler, Component, ComponentFactoryResolver, Directive, HostBinding, Inject, Injectable, InjectionToken, Injector, Input, NgModule, NgModuleRef, Optional, Pipe, Provider, Self, Type, forwardRef, getModuleFactory, ɵivyEnabled as ivyEnabled} from '@angular/core';
import {Console} from '@angular/core/src/console';
import {ΔInjectableDef, ΔdefineInjectable} from '@angular/core/src/di/interface/defs';
import {ɵɵInjectableDef, ɵɵdefineInjectable} from '@angular/core/src/di/interface/defs';
import {getNgModuleDef} from '@angular/core/src/render3/definition';
import {NgModuleData} from '@angular/core/src/view/types';
import {tokenKey} from '@angular/core/src/view/util';
@ -1362,7 +1362,7 @@ function declareTests(config?: {useJit: boolean}) {
}
class Bar {
static ngInjectableDef: ΔInjectableDef<Bar> = ΔdefineInjectable({
static ngInjectableDef: ɵɵInjectableDef<Bar> = ɵɵdefineInjectable({
factory: () => new Bar(),
providedIn: SomeModule,
});
@ -1394,7 +1394,7 @@ function declareTests(config?: {useJit: boolean}) {
}
class Bar {
static ngInjectableDef: ΔInjectableDef<Bar> = ΔdefineInjectable({
static ngInjectableDef: ɵɵInjectableDef<Bar> = ɵɵdefineInjectable({
factory: () => new Bar(),
providedIn: SomeModule,
});

View File

@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ΔdefineComponent} from '../../src/render3/index';
import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δtext} from '../../src/render3/instructions/all';
import {ɵɵdefineComponent} from '../../src/render3/index';
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵtext} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {document, renderComponent} from './render_util';
@ -33,31 +33,31 @@ describe('iv perf test', () => {
it(`${iteration}. create ${count} divs in Render3`, () => {
class Component {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Component,
selectors: [['div']],
consts: 1,
vars: 0,
template: function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
for (let i = 0; i < count; i++) {
let rf0 = ΔembeddedViewStart(0, 2, 0);
let rf0 = ɵɵembeddedViewStart(0, 2, 0);
{
if (rf0 & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δtext(1, '-');
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵtext(1, '-');
ɵɵelementEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
},
factory: () => new Component

View File

@ -11,8 +11,8 @@ import {withBody} from '@angular/private/testing';
import {ChangeDetectionStrategy, ChangeDetectorRef, DoCheck, RendererType2} from '../../src/core';
import {whenRendered} from '../../src/render3/component';
import {LifecycleHooksFeature, getRenderedText, ΔNgOnChangesFeature, ΔdefineComponent, ΔdefineDirective, ΔgetCurrentView, ΔtemplateRefExtractor} from '../../src/render3/index';
import {detectChanges, markDirty, tick, Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdirectiveInject, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δinterpolation2, Δlistener, Δreference, Δtemplate, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {LifecycleHooksFeature, getRenderedText, ɵɵNgOnChangesFeature, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵgetCurrentView, ɵɵtemplateRefExtractor} from '../../src/render3/index';
import {detectChanges, markDirty, tick, ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdirectiveInject, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵinterpolation2, ɵɵlistener, ɵɵreference, ɵɵtemplate, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {RElement, Renderer3, RendererFactory3} from '../../src/render3/interfaces/renderer';
import {FLAGS, LViewFlags} from '../../src/render3/interfaces/view';
@ -26,7 +26,7 @@ describe('change detection', () => {
doCheckCount = 0;
ngDoCheck(): void { this.doCheckCount++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['my-comp']],
factory: () => new MyComponent(),
@ -34,12 +34,12 @@ describe('change detection', () => {
vars: 1,
template: (rf: RenderFlags, ctx: MyComponent) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
Δtext(1);
ΔelementEnd();
ɵɵelementStart(0, 'span');
ɵɵtext(1);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔtextBinding(1, Δbind(ctx.value));
ɵɵtextBinding(1, ɵɵbind(ctx.value));
}
}
});
@ -101,7 +101,7 @@ describe('change detection', () => {
onClick() {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['my-comp']],
factory: () => comp = new MyComponent(),
@ -113,15 +113,15 @@ describe('change detection', () => {
*/
template: (rf: RenderFlags, ctx: MyComponent) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ΔelementStart(1, 'button');
ɵɵtext(0);
ɵɵelementStart(1, 'button');
{
Δlistener('click', () => { ctx.onClick(); });
ɵɵlistener('click', () => { ctx.onClick(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation2('', ctx.doCheckCount, ' - ', ctx.name, ''));
ɵɵtextBinding(0, ɵɵinterpolation2('', ctx.doCheckCount, ' - ', ctx.name, ''));
}
},
changeDetection: ChangeDetectionStrategy.OnPush,
@ -132,7 +132,7 @@ describe('change detection', () => {
class MyApp {
name: string = 'Nancy';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
selectors: [['my-app']],
factory: () => new MyApp(),
@ -141,10 +141,10 @@ describe('change detection', () => {
/** <my-comp [name]="name"></my-comp> */
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'my-comp');
ɵɵelement(0, 'my-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'name', Δbind(ctx.name));
ɵɵelementProperty(0, 'name', ɵɵbind(ctx.name));
}
},
directives: () => [MyComponent]
@ -222,10 +222,10 @@ describe('change detection', () => {
const ButtonParent = createComponent('button-parent', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'my-comp');
ΔelementStart(1, 'button', ['id', 'parent']);
{ Δlistener('click', () => noop()); }
ΔelementEnd();
ɵɵelement(0, 'my-comp');
ɵɵelementStart(1, 'button', ['id', 'parent']);
{ ɵɵlistener('click', () => noop()); }
ɵɵelementEnd();
}
}, 2, 0, [MyComponent]);
@ -247,7 +247,7 @@ describe('change detection', () => {
doCheckCount = 0;
ngDoCheck(): void { this.doCheckCount++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ButtonParent,
selectors: [['button-parent']],
factory: () => parent = new ButtonParent(),
@ -256,11 +256,11 @@ describe('change detection', () => {
/** {{ doCheckCount }} - <my-comp></my-comp> */
template: (rf: RenderFlags, ctx: ButtonParent) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'my-comp');
ɵɵtext(0);
ɵɵelement(1, 'my-comp');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ctx.doCheckCount, ' - '));
ɵɵtextBinding(0, ɵɵinterpolation1('', ctx.doCheckCount, ' - '));
}
},
directives: () => [MyComponent],
@ -270,7 +270,7 @@ describe('change detection', () => {
const MyButtonApp = createComponent('my-button-app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'button-parent');
ɵɵelement(0, 'button-parent');
}
}, 1, 0, [ButtonParent]);
@ -308,7 +308,7 @@ describe('change detection', () => {
onClick() {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ManualComponent,
selectors: [['manual-comp']],
factory: () => comp = new ManualComponent(),
@ -322,18 +322,18 @@ describe('change detection', () => {
if (rf & RenderFlags.Create) {
// This is temporarily the only way to turn on manual change detection
// because public API has not yet been added.
const view = ΔgetCurrentView() as any;
const view = ɵɵgetCurrentView() as any;
view[FLAGS] |= LViewFlags.ManualOnPush;
Δtext(0);
ΔelementStart(1, 'button');
ɵɵtext(0);
ɵɵelementStart(1, 'button');
{
Δlistener('click', () => { ctx.onClick(); });
ɵɵlistener('click', () => { ctx.onClick(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation2('', ctx.doCheckCount, ' - ', ctx.name, ''));
ɵɵtextBinding(0, ɵɵinterpolation2('', ctx.doCheckCount, ' - ', ctx.name, ''));
}
},
changeDetection: ChangeDetectionStrategy.OnPush,
@ -344,7 +344,7 @@ describe('change detection', () => {
class ManualApp {
name: string = 'Nancy';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ManualApp,
selectors: [['manual-app']],
factory: () => new ManualApp(),
@ -353,10 +353,10 @@ describe('change detection', () => {
/** <manual-comp [name]="name"></manual-comp> */
template: (rf: RenderFlags, ctx: ManualApp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'manual-comp');
ɵɵelement(0, 'manual-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'name', Δbind(ctx.name));
ɵɵelementProperty(0, 'name', ɵɵbind(ctx.name));
}
},
@ -399,7 +399,7 @@ describe('change detection', () => {
doCheckCount = 0;
ngDoCheck(): void { this.doCheckCount++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ButtonParent,
selectors: [['button-parent']],
factory: () => parent = new ButtonParent(),
@ -408,11 +408,11 @@ describe('change detection', () => {
/** {{ doCheckCount }} - <manual-comp></manual-comp> */
template: (rf: RenderFlags, ctx: ButtonParent) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'manual-comp');
ɵɵtext(0);
ɵɵelement(1, 'manual-comp');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ctx.doCheckCount, ' - '));
ɵɵtextBinding(0, ɵɵinterpolation1('', ctx.doCheckCount, ' - '));
}
},
directives: () => [ManualComponent],
@ -423,7 +423,7 @@ describe('change detection', () => {
const MyButtonApp =
createComponent('my-button-app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'button-parent');
ɵɵelement(0, 'button-parent');
}
}, 1, 0, [ButtonParent]);
@ -476,19 +476,19 @@ describe('change detection', () => {
ngDoCheck() { this.doCheckCount++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComp,
selectors: [['my-comp']],
factory: () => myComp = new MyComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => myComp = new MyComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
/** {{ name }} */
template: (rf: RenderFlags, ctx: MyComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.name));
ɵɵtextBinding(0, ɵɵbind(ctx.name));
}
},
changeDetection: ChangeDetectionStrategy.OnPush
@ -502,10 +502,10 @@ describe('change detection', () => {
ngDoCheck() { this.doCheckCount++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ParentComp,
selectors: [['parent-comp']],
factory: () => new ParentComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new ParentComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 2,
vars: 1,
/**
@ -514,11 +514,11 @@ describe('change detection', () => {
*/
template: (rf: RenderFlags, ctx: ParentComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'my-comp');
ɵɵtext(0);
ɵɵelement(1, 'my-comp');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ctx.doCheckCount, ' - '));
ɵɵtextBinding(0, ɵɵinterpolation1('', ctx.doCheckCount, ' - '));
}
},
directives: () => [MyComp]
@ -528,10 +528,10 @@ describe('change detection', () => {
class Dir {
constructor(public cdr: ChangeDetectorRef) {}
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Dir,
selectors: [['', 'dir', '']],
factory: () => dir = new Dir(ΔdirectiveInject(ChangeDetectorRef as any))
factory: () => dir = new Dir(ɵɵdirectiveInject(ChangeDetectorRef as any))
});
}
@ -593,7 +593,7 @@ describe('change detection', () => {
/** <my-comp dir></my-comp> */
const MyApp = createComponent('my-app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'my-comp', ['dir', '']);
ɵɵelement(0, 'my-comp', ['dir', '']);
}
}, 1, 0, [MyComp, Dir]);
@ -612,11 +612,11 @@ describe('change detection', () => {
*/
const MyApp = createComponent('my-app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'div', ['dir', '']);
ɵɵtext(0);
ɵɵelement(1, 'div', ['dir', '']);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(1, Δbind(ctx.value));
ɵɵtextBinding(1, ɵɵbind(ctx.value));
}
}, 2, 1, [Dir]);
@ -637,10 +637,10 @@ describe('change detection', () => {
constructor(public cdr: ChangeDetectorRef) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
selectors: [['my-app']],
factory: () => new MyApp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new MyApp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 2,
vars: 1,
/**
@ -651,22 +651,22 @@ describe('change detection', () => {
*/
template: function(rf: RenderFlags, ctx: MyApp) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δcontainer(1);
ɵɵtext(0);
ɵɵcontainer(1);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.name));
ΔcontainerRefreshStart(1);
ɵɵtextBinding(0, ɵɵbind(ctx.name));
ɵɵcontainerRefreshStart(1);
{
if (ctx.showing) {
let rf0 = ΔembeddedViewStart(0, 1, 0);
let rf0 = ɵɵembeddedViewStart(0, 1, 0);
if (rf0 & RenderFlags.Create) {
Δelement(0, 'div', ['dir', '']);
ɵɵelement(0, 'div', ['dir', '']);
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
},
directives: [Dir]
@ -692,19 +692,19 @@ describe('change detection', () => {
this.cdr.detectChanges();
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: DetectChangesComp,
selectors: [['detect-changes-comp']],
factory: () => new DetectChangesComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new DetectChangesComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
/** {{ value }} */
template: (rf: RenderFlags, ctx: DetectChangesComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
}
});
@ -737,19 +737,19 @@ describe('change detection', () => {
}
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ChildComp,
selectors: [['child-comp']],
factory: () => new ChildComp(ΔdirectiveInject(ParentComp as any)),
factory: () => new ChildComp(ɵɵdirectiveInject(ParentComp as any)),
consts: 1,
vars: 0,
template: (rf: RenderFlags, ctx: ChildComp) => {
if (rf & RenderFlags.Create) {
Δtext(0, 'foo');
ɵɵtext(0, 'foo');
}
},
inputs: {inp: 'inp'},
features: [ΔNgOnChangesFeature]
features: [ɵɵNgOnChangesFeature]
});
}
@ -758,19 +758,19 @@ describe('change detection', () => {
triggerChangeDetection() { this.cdr.detectChanges(); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ParentComp,
selectors: [['parent-comp']],
factory: () => new ParentComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new ParentComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
/** {{ value }} */
template: (rf: RenderFlags, ctx: ParentComp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'child-comp');
ɵɵelement(0, 'child-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'inp', Δbind(true));
ɵɵelementProperty(0, 'inp', ɵɵbind(true));
}
},
directives: [ChildComp]
@ -792,19 +792,19 @@ describe('change detection', () => {
this.cdr.detectChanges();
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: DetectChangesComp,
selectors: [['detect-changes-comp']],
factory: () => new DetectChangesComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new DetectChangesComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
/** {{ doCheckCount }} */
template: (rf: RenderFlags, ctx: DetectChangesComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.doCheckCount));
ɵɵtextBinding(0, ɵɵbind(ctx.doCheckCount));
}
}
});
@ -827,20 +827,20 @@ describe('change detection', () => {
create() { return this.vcr.createEmbeddedView(this.tmp, this); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: StructuralComp,
selectors: [['structural-comp']],
factory: () => structuralComp =
new StructuralComp(ΔdirectiveInject(ViewContainerRef as any)),
new StructuralComp(ɵɵdirectiveInject(ViewContainerRef as any)),
inputs: {tmp: 'tmp'},
consts: 1,
vars: 1,
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
}
});
@ -849,10 +849,10 @@ describe('change detection', () => {
it('should support ViewRef.detectChanges()', () => {
function FooTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
}
@ -862,13 +862,13 @@ describe('change detection', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(
0, FooTemplate, 1, 1, 'ng-template', null, ['foo', ''], ΔtemplateRefExtractor);
Δelement(2, 'structural-comp');
ɵɵtemplate(
0, FooTemplate, 1, 1, 'ng-template', null, ['foo', ''], ɵɵtemplateRefExtractor);
ɵɵelement(2, 'structural-comp');
}
if (rf & RenderFlags.Update) {
const foo = Δreference(1) as any;
ΔelementProperty(2, 'tmp', Δbind(foo));
const foo = ɵɵreference(1) as any;
ɵɵelementProperty(2, 'tmp', ɵɵbind(foo));
}
}, 3, 1, [StructuralComp]);
@ -894,7 +894,7 @@ describe('change detection', () => {
it('should support ViewRef.detectChanges() directly after creation', () => {
function FooTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0, 'Template text');
ɵɵtext(0, 'Template text');
}
}
@ -904,13 +904,13 @@ describe('change detection', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(
0, FooTemplate, 1, 0, 'ng-template', null, ['foo', ''], ΔtemplateRefExtractor);
Δelement(2, 'structural-comp');
ɵɵtemplate(
0, FooTemplate, 1, 0, 'ng-template', null, ['foo', ''], ɵɵtemplateRefExtractor);
ɵɵelement(2, 'structural-comp');
}
if (rf & RenderFlags.Update) {
const foo = Δreference(1) as any;
ΔelementProperty(2, 'tmp', Δbind(foo));
const foo = ɵɵreference(1) as any;
ɵɵelementProperty(2, 'tmp', ɵɵbind(foo));
}
}, 3, 1, [StructuralComp]);
@ -933,16 +933,16 @@ describe('change detection', () => {
class MyApp {
constructor(public cdr: ChangeDetectorRef) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
selectors: [['my-app']],
factory: () => new MyApp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new MyApp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 0,
/** <detached-comp></detached-comp> */
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'detached-comp');
ɵɵelement(0, 'detached-comp');
}
},
directives: () => [DetachedComp]
@ -957,19 +957,19 @@ describe('change detection', () => {
ngDoCheck() { this.doCheckCount++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: DetachedComp,
selectors: [['detached-comp']],
factory: () => comp = new DetachedComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => comp = new DetachedComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
/** {{ value }} */
template: (rf: RenderFlags, ctx: DetachedComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
}
});
@ -1058,19 +1058,19 @@ describe('change detection', () => {
constructor(public cdr: ChangeDetectorRef) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: OnPushComp,
selectors: [['on-push-comp']],
factory: () => onPushComp = new OnPushComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => onPushComp = new OnPushComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
/** {{ value }} */
template: (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
},
changeDetection: ChangeDetectionStrategy.OnPush,
@ -1081,10 +1081,10 @@ describe('change detection', () => {
/** <on-push-comp [value]="value"></on-push-comp> */
const OnPushApp = createComponent('on-push-app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'on-push-comp');
ɵɵelement(0, 'on-push-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'value', Δbind(ctx.value));
ɵɵelementProperty(0, 'value', ɵɵbind(ctx.value));
}
}, 1, 1, [OnPushComp]);
@ -1119,19 +1119,19 @@ describe('change detection', () => {
ngDoCheck() { this.doCheckCount++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: OnPushComp,
selectors: [['on-push-comp']],
factory: () => comp = new OnPushComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => comp = new OnPushComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
/** {{ value }} */
template: (rf: RenderFlags, ctx: OnPushComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
},
changeDetection: ChangeDetectionStrategy.OnPush
@ -1141,7 +1141,7 @@ describe('change detection', () => {
class OnPushParent {
value = 'one';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: OnPushParent,
selectors: [['on-push-parent']],
factory: () => new OnPushParent(),
@ -1153,11 +1153,11 @@ describe('change detection', () => {
*/
template: (rf: RenderFlags, ctx: OnPushParent) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'on-push-comp');
ɵɵtext(0);
ɵɵelement(1, 'on-push-comp');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ctx.value, ' - '));
ɵɵtextBinding(0, ɵɵinterpolation1('', ctx.value, ' - '));
}
},
directives: () => [OnPushComp],
@ -1213,7 +1213,7 @@ describe('change detection', () => {
value = 'one';
showing = true;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: EmbeddedViewParent,
selectors: [['embedded-view-parent']],
factory: () => new EmbeddedViewParent(),
@ -1227,22 +1227,22 @@ describe('change detection', () => {
*/
template: (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δcontainer(1);
ɵɵtext(0);
ɵɵcontainer(1);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ctx.value, ' - '));
ΔcontainerRefreshStart(1);
ɵɵtextBinding(0, ɵɵinterpolation1('', ctx.value, ' - '));
ɵɵcontainerRefreshStart(1);
{
if (ctx.showing) {
let rf0 = ΔembeddedViewStart(0, 1, 0);
let rf0 = ɵɵembeddedViewStart(0, 1, 0);
if (rf0 & RenderFlags.Create) {
Δelement(0, 'on-push-comp');
ɵɵelement(0, 'on-push-comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
},
directives: () => [OnPushComp],
@ -1293,18 +1293,18 @@ describe('change detection', () => {
constructor(public cdr: ChangeDetectorRef) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: NoChangesComp,
selectors: [['no-changes-comp']],
factory: () => comp = new NoChangesComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => comp = new NoChangesComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 1,
template: (rf: RenderFlags, ctx: NoChangesComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
}
});
@ -1315,10 +1315,10 @@ describe('change detection', () => {
constructor(public cdr: ChangeDetectorRef) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: AppComp,
selectors: [['app-comp']],
factory: () => new AppComp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new AppComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 2,
vars: 1,
/**
@ -1327,11 +1327,11 @@ describe('change detection', () => {
*/
template: (rf: RenderFlags, ctx: AppComp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'no-changes-comp');
ɵɵtext(0);
ɵɵelement(1, 'no-changes-comp');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ctx.value, ' - '));
ɵɵtextBinding(0, ɵɵinterpolation1('', ctx.value, ' - '));
}
},
directives: () => [NoChangesComp]
@ -1378,10 +1378,10 @@ describe('change detection', () => {
constructor(public cdr: ChangeDetectorRef) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: EmbeddedViewApp,
selectors: [['embedded-view-app']],
factory: () => new EmbeddedViewApp(ΔdirectiveInject(ChangeDetectorRef as any)),
factory: () => new EmbeddedViewApp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
consts: 1,
vars: 0,
/**
@ -1391,23 +1391,23 @@ describe('change detection', () => {
*/
template: (rf: RenderFlags, ctx: EmbeddedViewApp) => {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.showing) {
let rf0 = ΔembeddedViewStart(0, 1, 1);
let rf0 = ɵɵembeddedViewStart(0, 1, 1);
if (rf0 & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf0 & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
});
@ -1463,7 +1463,7 @@ describe('change detection', () => {
return 'works';
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['my-comp']],
factory: () => new MyComponent(),
@ -1471,10 +1471,10 @@ describe('change detection', () => {
vars: 1,
template: (rf: RenderFlags, ctx: MyComponent) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.value));
ɵɵtextBinding(0, ɵɵbind(ctx.value));
}
}
});

View File

@ -8,10 +8,10 @@
import {NgForOfContext} from '@angular/common';
import {AttributeMarker, ΔdefineComponent, Δelement, ΔgetCurrentView, ΔtemplateRefExtractor} from '../../src/render3/index';
import {Δbind, ΔelementContainerEnd, ΔelementContainerStart, ΔelementEnd, ΔelementProperty, ΔelementStart, Δinterpolation1, Δinterpolation2, Δinterpolation3, ΔinterpolationV, Δlistener, Δload, ΔnextContext, Δreference, Δtemplate, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {AttributeMarker, ɵɵdefineComponent, ɵɵelement, ɵɵgetCurrentView, ɵɵtemplateRefExtractor} from '../../src/render3/index';
import {ɵɵbind, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵinterpolation1, ɵɵinterpolation2, ɵɵinterpolation3, ɵɵinterpolationV, ɵɵlistener, ɵɵload, ɵɵnextContext, ɵɵreference, ɵɵtemplate, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {ΔrestoreView} from '../../src/render3/state';
import {ɵɵrestoreView} from '../../src/render3/state';
import {NgForOf, NgIf, NgTemplateOutlet} from './common_with_def';
import {ComponentFixture, createDirective, getDirectiveOnNode} from './render_util';
@ -22,20 +22,20 @@ describe('@angular/common integration', () => {
it('should update a loop', () => {
function liTemplate(rf: RenderFlags, ctx: NgForOfContext<string>) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'li');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'li');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item = ctx.$implicit;
ΔtextBinding(1, Δbind(item));
ɵɵtextBinding(1, ɵɵbind(item));
}
}
class MyApp {
items: string[] = ['first', 'second'];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -46,15 +46,15 @@ describe('@angular/common integration', () => {
// </ul>
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'ul');
ɵɵelementStart(0, 'ul');
{
Δtemplate(
ɵɵtemplate(
1, liTemplate, 2, 1, 'li', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(1, 'ngForOf', Δbind(ctx.items));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(ctx.items));
}
},
directives: () => [NgForOf]
@ -87,20 +87,20 @@ describe('@angular/common integration', () => {
it('should support ngForOf context variables', () => {
function liTemplate(rf: RenderFlags, ctx: NgForOfContext<string>) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'li');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'li');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item = ctx.$implicit;
ΔtextBinding(1, Δinterpolation3('', ctx.index, ' of ', ctx.count, ': ', item, ''));
ɵɵtextBinding(1, ɵɵinterpolation3('', ctx.index, ' of ', ctx.count, ': ', item, ''));
}
}
class MyApp {
items: string[] = ['first', 'second'];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -112,15 +112,15 @@ describe('@angular/common integration', () => {
// </ul>
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'ul');
ɵɵelementStart(0, 'ul');
{
Δtemplate(
ɵɵtemplate(
1, liTemplate, 2, 3, 'li', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(1, 'ngForOf', Δbind(ctx.items));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(ctx.items));
}
},
@ -143,7 +143,7 @@ describe('@angular/common integration', () => {
const Dir = createDirective('dir');
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -151,9 +151,9 @@ describe('@angular/common integration', () => {
vars: 0,
template: (rf: RenderFlags, cmp: Comp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div', ['dir', '']);
{ Δtext(1, 'comp text'); }
ΔelementEnd();
ɵɵelementStart(0, 'div', ['dir', '']);
{ ɵɵtext(1, 'comp text'); }
ɵɵelementEnd();
// testing only
dirs.push(getDirectiveOnNode(0));
}
@ -164,7 +164,7 @@ describe('@angular/common integration', () => {
function ngForTemplate(rf: RenderFlags, ctx: NgForOfContext<string>) {
if (rf & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
}
@ -172,7 +172,7 @@ describe('@angular/common integration', () => {
class MyApp {
rows: string[] = ['first', 'second'];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -180,11 +180,11 @@ describe('@angular/common integration', () => {
vars: 1,
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
Δtemplate(
ɵɵtemplate(
0, ngForTemplate, 1, 0, 'comp', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngForOf', Δbind(ctx.rows));
ɵɵelementProperty(0, 'ngForOf', ɵɵbind(ctx.rows));
}
},
directives: () => [NgForOf, Comp, Dir]
@ -212,13 +212,13 @@ describe('@angular/common integration', () => {
function liTemplate(rf: RenderFlags, ctx: NgForOfContext<string>) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'li');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'li');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item = ctx.$implicit;
ΔtextBinding(1, Δinterpolation1('', item, ''));
ɵɵtextBinding(1, ɵɵinterpolation1('', item, ''));
}
}
@ -234,7 +234,7 @@ describe('@angular/common integration', () => {
}
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -246,21 +246,21 @@ describe('@angular/common integration', () => {
// </ul>
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.toggle(); });
Δtext(1, 'Toggle List');
ɵɵlistener('click', function() { return ctx.toggle(); });
ɵɵtext(1, 'Toggle List');
}
ΔelementEnd();
ΔelementStart(2, 'ul');
ɵɵelementEnd();
ɵɵelementStart(2, 'ul');
{
Δtemplate(
ɵɵtemplate(
3, liTemplate, 2, 1, 'li', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(3, 'ngForOf', Δbind(ctx.items));
ɵɵelementProperty(3, 'ngForOf', ɵɵbind(ctx.items));
}
},
@ -302,7 +302,7 @@ describe('@angular/common integration', () => {
class MyApp {
items: any[] = [{data: ['1', '2'], value: 'first'}, {data: ['3', '4'], value: 'second'}];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -310,15 +310,15 @@ describe('@angular/common integration', () => {
vars: 1,
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'ul');
ɵɵelementStart(0, 'ul');
{
Δtemplate(
ɵɵtemplate(
1, liTemplate, 2, 1, 'li', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(1, 'ngForOf', Δbind(ctx.items));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(ctx.items));
}
},
@ -328,30 +328,31 @@ describe('@angular/common integration', () => {
function liTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'li');
ɵɵelementStart(0, 'li');
{
Δtemplate(
ɵɵtemplate(
1, spanTemplate, 2, 3, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const row = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(row.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(row.data));
}
}
function spanTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const cell = ctx.$implicit;
const row = ΔnextContext().$implicit as any;
const app = ΔnextContext() as any;
ΔtextBinding(1, Δinterpolation3('', cell, ' - ', row.value, ' - ', app.items.length, ''));
const row = ɵɵnextContext().$implicit as any;
const app = ɵɵnextContext() as any;
ɵɵtextBinding(
1, ɵɵinterpolation3('', cell, ' - ', row.value, ' - ', app.items.length, ''));
}
}
@ -399,7 +400,7 @@ describe('@angular/common integration', () => {
onClick(value: string, name: string) { this.events.push(value, name); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -407,11 +408,11 @@ describe('@angular/common integration', () => {
vars: 1,
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
Δtemplate(
ɵɵtemplate(
0, divTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngForOf', Δbind(ctx.items));
ɵɵelementProperty(0, 'ngForOf', ɵɵbind(ctx.items));
}
},
@ -421,39 +422,39 @@ describe('@angular/common integration', () => {
function divTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtemplate(1, pTemplate, 3, 2, 'p', [AttributeMarker.Template, 'ngFor', 'ngForOf']); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtemplate(1, pTemplate, 3, 2, 'p', [AttributeMarker.Template, 'ngFor', 'ngForOf']); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const row = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(row.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(row.data));
}
}
function pTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
const state = ΔgetCurrentView();
ΔelementStart(0, 'p');
const state = ɵɵgetCurrentView();
ɵɵelementStart(0, 'p');
{
ΔelementStart(1, 'span');
ɵɵelementStart(1, 'span');
{
Δlistener('click', () => {
ΔrestoreView(state);
const row = ΔnextContext().$implicit as any;
const app = ΔnextContext();
ɵɵlistener('click', () => {
ɵɵrestoreView(state);
const row = ɵɵnextContext().$implicit as any;
const app = ɵɵnextContext();
app.onClick(row.value, app.name);
});
}
ΔelementEnd();
Δtext(2);
ɵɵelementEnd();
ɵɵtext(2);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const row = ΔnextContext().$implicit as any;
const app = ΔnextContext() as any;
ΔtextBinding(2, Δinterpolation2('', row.value, ' - ', app.name, ''));
const row = ɵɵnextContext().$implicit as any;
const app = ɵɵnextContext() as any;
ɵɵtextBinding(2, ɵɵinterpolation2('', row.value, ' - ', app.name, ''));
}
}
@ -494,7 +495,7 @@ describe('@angular/common integration', () => {
[{value: 'two', data: ['3', '4']}]
];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -502,11 +503,11 @@ describe('@angular/common integration', () => {
vars: 1,
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
Δtemplate(
ɵɵtemplate(
0, divTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngForOf', Δbind(ctx.items));
ɵɵelementProperty(0, 'ngForOf', ɵɵbind(ctx.items));
}
},
@ -516,44 +517,44 @@ describe('@angular/common integration', () => {
function divTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ɵɵelementStart(0, 'div');
{
Δtemplate(
ɵɵtemplate(
1, innerDivTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const row = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(row));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(row));
}
}
function innerDivTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ɵɵelementStart(0, 'div');
{
Δtemplate(
ɵɵtemplate(
1, spanTemplate, 2, 2, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const cell = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(cell.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(cell.data));
}
}
function spanTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const cell = ΔnextContext().$implicit as any;
const app = ΔnextContext(2) as any;
ΔtextBinding(1, Δinterpolation2('', cell.value, ' - ', app.name, ''));
const cell = ɵɵnextContext().$implicit as any;
const app = ɵɵnextContext(2) as any;
ɵɵtextBinding(1, ɵɵinterpolation2('', cell.value, ' - ', app.name, ''));
}
}
@ -669,7 +670,7 @@ describe('@angular/common integration', () => {
}
];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -677,11 +678,11 @@ describe('@angular/common integration', () => {
vars: 1,
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
Δtemplate(
ɵɵtemplate(
0, itemTemplate0, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngForOf', Δbind(ctx.items));
ɵɵelementProperty(0, 'ngForOf', ɵɵbind(ctx.items));
}
},
@ -691,147 +692,147 @@ describe('@angular/common integration', () => {
function itemTemplate0(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate1, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item0 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item0.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item0.data));
}
}
function itemTemplate1(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate2, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item1 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item1.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item1.data));
}
}
function itemTemplate2(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate3, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item2 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item2.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item2.data));
}
}
function itemTemplate3(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate4, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item3 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item3.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item3.data));
}
}
function itemTemplate4(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate5, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item4 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item4.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item4.data));
}
}
function itemTemplate5(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate6, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item5 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item5.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item5.data));
}
}
function itemTemplate6(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate7, 2, 1, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item6 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item6.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item6.data));
}
}
function itemTemplate7(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
ɵɵelementStart(0, 'span');
{
Δtemplate(
ɵɵtemplate(
1, itemTemplate8, 2, 10, 'span', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const item7 = ctx.$implicit as any;
ΔelementProperty(1, 'ngForOf', Δbind(item7.data));
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(item7.data));
}
}
function itemTemplate8(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const value = ctx.$implicit;
const item7 = ΔnextContext().$implicit;
const item6 = ΔnextContext().$implicit;
const item5 = ΔnextContext().$implicit;
const item4 = ΔnextContext().$implicit;
const item3 = ΔnextContext().$implicit;
const item2 = ΔnextContext().$implicit;
const item1 = ΔnextContext().$implicit;
const item0 = ΔnextContext().$implicit;
const myApp = ΔnextContext();
ΔtextBinding(1, ΔinterpolationV([
'', value, '.', item7.value, '.', item6.value, '.', item5.value,
'.', item4.value, '.', item3.value, '.', item2.value, '.', item1.value,
'.', item0.value, '.', myApp.value, ''
]));
const item7 = ɵɵnextContext().$implicit;
const item6 = ɵɵnextContext().$implicit;
const item5 = ɵɵnextContext().$implicit;
const item4 = ɵɵnextContext().$implicit;
const item3 = ɵɵnextContext().$implicit;
const item2 = ɵɵnextContext().$implicit;
const item1 = ɵɵnextContext().$implicit;
const item0 = ɵɵnextContext().$implicit;
const myApp = ɵɵnextContext();
ɵɵtextBinding(1, ɵɵinterpolationV([
'', value, '.', item7.value, '.', item6.value, '.', item5.value,
'.', item4.value, '.', item3.value, '.', item2.value, '.', item1.value,
'.', item0.value, '.', myApp.value, ''
]));
}
}
@ -858,7 +859,7 @@ describe('@angular/common integration', () => {
valueOne = 'one';
valueTwo = 'two';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -870,12 +871,12 @@ describe('@angular/common integration', () => {
*/
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
Δtemplate(0, templateOne, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']);
Δtemplate(1, templateTwo, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']);
ɵɵtemplate(0, templateOne, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']);
ɵɵtemplate(1, templateTwo, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngIf', Δbind(ctx.showing));
ΔelementProperty(1, 'ngIf', Δbind(ctx.showing));
ɵɵelementProperty(0, 'ngIf', ɵɵbind(ctx.showing));
ɵɵelementProperty(1, 'ngIf', ɵɵbind(ctx.showing));
}
},
@ -885,25 +886,25 @@ describe('@angular/common integration', () => {
function templateOne(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const myApp = ΔnextContext();
ΔtextBinding(1, Δbind(myApp.valueOne));
const myApp = ɵɵnextContext();
ɵɵtextBinding(1, ɵɵbind(myApp.valueOne));
}
}
function templateTwo(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const myApp = ΔnextContext();
ΔtextBinding(1, Δbind(myApp.valueTwo));
const myApp = ɵɵnextContext();
ɵɵtextBinding(1, ɵɵbind(myApp.valueTwo));
}
}
@ -932,7 +933,7 @@ describe('@angular/common integration', () => {
innerShowing = true;
name = 'App name';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: AppComponent,
factory: () => new AppComponent(),
selectors: [['my-app']],
@ -940,10 +941,10 @@ describe('@angular/common integration', () => {
vars: 1,
template: (rf: RenderFlags, ctx: AppComponent) => {
if (rf & RenderFlags.Create) {
Δtemplate(0, divTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']);
ɵɵtemplate(0, divTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngIf', Δbind(ctx.showing));
ɵɵelementProperty(0, 'ngIf', ɵɵbind(ctx.showing));
}
},
@ -953,37 +954,37 @@ describe('@angular/common integration', () => {
function divTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtemplate(1, outerDivTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtemplate(1, outerDivTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const app = ΔnextContext();
ΔelementProperty(1, 'ngIf', Δbind(app.outerShowing));
const app = ɵɵnextContext();
ɵɵelementProperty(1, 'ngIf', ɵɵbind(app.outerShowing));
}
}
function outerDivTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtemplate(1, innerDivTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtemplate(1, innerDivTemplate, 2, 1, 'div', [AttributeMarker.Template, 'ngIf']); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const app = ΔnextContext(2);
ΔelementProperty(1, 'ngIf', Δbind(app.innerShowing));
const app = ɵɵnextContext(2);
ɵɵelementProperty(1, 'ngIf', ɵɵbind(app.innerShowing));
}
}
function innerDivTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const app = ΔnextContext(3);
ΔtextBinding(1, Δbind(app.name));
const app = ɵɵnextContext(3);
ɵɵtextBinding(1, ɵɵbind(app.name));
}
}
@ -1003,7 +1004,7 @@ describe('@angular/common integration', () => {
class MyApp {
showing = false;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -1015,17 +1016,17 @@ describe('@angular/common integration', () => {
*/
template: (rf: RenderFlags, myApp: MyApp) => {
if (rf & RenderFlags.Create) {
Δtemplate(0, (rf1: RenderFlags) => {
ɵɵtemplate(0, (rf1: RenderFlags) => {
if (rf1 & RenderFlags.Create) {
Δtext(0, 'from tpl');
ɵɵtext(0, 'from tpl');
}
}, 1, 0, 'ng-template', undefined, ['tpl', ''], ΔtemplateRefExtractor);
Δtemplate(
}, 1, 0, 'ng-template', undefined, ['tpl', ''], ɵɵtemplateRefExtractor);
ɵɵtemplate(
2, null, 0, 0, 'ng-template', [AttributeMarker.Bindings, 'ngTemplateOutlet']);
}
if (rf & RenderFlags.Update) {
const tplRef = Δload(1);
ΔelementProperty(2, 'ngTemplateOutlet', Δbind(myApp.showing ? tplRef : null));
const tplRef = ɵɵload(1);
ɵɵelementProperty(2, 'ngTemplateOutlet', ɵɵbind(myApp.showing ? tplRef : null));
}
},
directives: () => [NgTemplateOutlet]
@ -1047,7 +1048,7 @@ describe('@angular/common integration', () => {
it('should allow usage on ng-container', () => {
class MyApp {
showing = false;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
factory: () => new MyApp(),
selectors: [['my-app']],
@ -1059,17 +1060,17 @@ describe('@angular/common integration', () => {
*/
template: (rf: RenderFlags, myApp: MyApp) => {
if (rf & RenderFlags.Create) {
Δtemplate(0, (rf1: RenderFlags) => {
ɵɵtemplate(0, (rf1: RenderFlags) => {
if (rf1 & RenderFlags.Create) {
Δtext(0, 'from tpl');
ɵɵtext(0, 'from tpl');
}
}, 1, 0, 'ng-template', undefined, ['tpl', ''], ΔtemplateRefExtractor);
ΔelementContainerStart(2, [AttributeMarker.Bindings, 'ngTemplateOutlet']);
ΔelementContainerEnd();
}, 1, 0, 'ng-template', undefined, ['tpl', ''], ɵɵtemplateRefExtractor);
ɵɵelementContainerStart(2, [AttributeMarker.Bindings, 'ngTemplateOutlet']);
ɵɵelementContainerEnd();
}
if (rf & RenderFlags.Update) {
const tplRef = Δreference(1);
ΔelementProperty(2, 'ngTemplateOutlet', Δbind(myApp.showing ? tplRef : null));
const tplRef = ɵɵreference(1);
ɵɵelementProperty(2, 'ngTemplateOutlet', ɵɵbind(myApp.showing ? tplRef : null));
}
},
directives: () => [NgTemplateOutlet]

View File

@ -9,18 +9,18 @@
import {NgForOf as NgForOfDef, NgIf as NgIfDef, NgTemplateOutlet as NgTemplateOutletDef} from '@angular/common';
import {IterableDiffers, TemplateRef, ViewContainerRef} from '@angular/core';
import {DirectiveType, ΔNgOnChangesFeature, ΔdefineDirective, ΔdirectiveInject} from '../../src/render3/index';
import {DirectiveType, ɵɵNgOnChangesFeature, ɵɵdefineDirective, ɵɵdirectiveInject} from '../../src/render3/index';
export const NgForOf: DirectiveType<NgForOfDef<any>> = NgForOfDef as any;
export const NgIf: DirectiveType<NgIfDef> = NgIfDef as any;
export const NgTemplateOutlet: DirectiveType<NgTemplateOutletDef> = NgTemplateOutletDef as any;
NgForOf.ngDirectiveDef = ΔdefineDirective({
NgForOf.ngDirectiveDef = ɵɵdefineDirective({
type: NgForOfDef,
selectors: [['', 'ngForOf', '']],
factory: () => new NgForOfDef(
ΔdirectiveInject(ViewContainerRef as any), ΔdirectiveInject(TemplateRef as any),
ΔdirectiveInject(IterableDiffers)),
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any),
ɵɵdirectiveInject(IterableDiffers)),
inputs: {
ngForOf: 'ngForOf',
ngForTrackBy: 'ngForTrackBy',
@ -28,19 +28,19 @@ NgForOf.ngDirectiveDef = ΔdefineDirective({
}
});
(NgIf as any).ngDirectiveDef = ΔdefineDirective({
(NgIf as any).ngDirectiveDef = ɵɵdefineDirective({
type: NgIfDef,
selectors: [['', 'ngIf', '']],
factory: () => new NgIfDef(
ΔdirectiveInject(ViewContainerRef as any), ΔdirectiveInject(TemplateRef as any)),
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any)),
inputs: {ngIf: 'ngIf', ngIfThen: 'ngIfThen', ngIfElse: 'ngIfElse'}
});
(NgTemplateOutlet as any).ngDirectiveDef = ΔdefineDirective({
(NgTemplateOutlet as any).ngDirectiveDef = ɵɵdefineDirective({
type: NgTemplateOutletDef,
selectors: [['', 'ngTemplateOutlet', '']],
factory: () => new NgTemplateOutletDef(ΔdirectiveInject(ViewContainerRef as any)),
features: [ΔNgOnChangesFeature()],
factory: () => new NgTemplateOutletDef(ɵɵdirectiveInject(ViewContainerRef as any)),
features: [ɵɵNgOnChangesFeature()],
inputs:
{ngTemplateOutlet: 'ngTemplateOutlet', ngTemplateOutletContext: 'ngTemplateOutletContext'}
});

View File

@ -10,7 +10,7 @@ import {Injector, NgModuleRef, ViewEncapsulation} from '../../src/core';
import {ComponentFactory} from '../../src/linker/component_factory';
import {RendererFactory2} from '../../src/render/api';
import {injectComponentFactoryResolver} from '../../src/render3/component_ref';
import {ΔdefineComponent} from '../../src/render3/index';
import {ɵɵdefineComponent} from '../../src/render3/index';
import {domRendererFactory3} from '../../src/render3/interfaces/renderer';
import {Sanitizer} from '../../src/sanitization/security';
@ -20,7 +20,7 @@ describe('ComponentFactory', () => {
describe('constructor()', () => {
it('should correctly populate default properties', () => {
class TestComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: TestComponent,
selectors: [['test', 'foo'], ['bar']],
consts: 0,
@ -41,7 +41,7 @@ describe('ComponentFactory', () => {
it('should correctly populate defined properties', () => {
class TestComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: TestComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['test', 'foo'], ['bar']],
@ -89,7 +89,7 @@ describe('ComponentFactory', () => {
createRenderer3Spy = spyOn(domRendererFactory3, 'createRenderer').and.callThrough();
class TestComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: TestComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['test']],

View File

@ -6,10 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
import {InjectionToken, ViewEncapsulation, ΔdefineInjectable, ΔdefineInjector} from '../../src/core';
import {InjectionToken, ViewEncapsulation, ɵɵdefineInjectable, ɵɵdefineInjector} from '../../src/core';
import {createInjector} from '../../src/di/r3_injector';
import {AttributeMarker, ComponentFactory, LifecycleHooksFeature, getRenderedText, markDirty, ΔProvidersFeature, ΔdefineComponent, ΔdirectiveInject, Δtemplate} from '../../src/render3/index';
import {tick, Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, ΔnextContext, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {AttributeMarker, ComponentFactory, LifecycleHooksFeature, getRenderedText, markDirty, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdirectiveInject, ɵɵtemplate} from '../../src/render3/index';
import {tick, ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵnextContext, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {ComponentDef, RenderFlags} from '../../src/render3/interfaces/definition';
import {NgIf} from './common_with_def';
@ -22,7 +22,7 @@ describe('component', () => {
increment() { this.count++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: CounterComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['counter']],
@ -30,10 +30,10 @@ describe('component', () => {
vars: 1,
template: function(rf: RenderFlags, ctx: CounterComponent) {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.count));
ɵɵtextBinding(0, ɵɵbind(ctx.count));
}
},
factory: () => new CounterComponent,
@ -65,30 +65,30 @@ describe('component', () => {
class MyService {
constructor(public value: string) {}
static ngInjectableDef =
ΔdefineInjectable({providedIn: 'root', factory: () => new MyService('no-injector')});
ɵɵdefineInjectable({providedIn: 'root', factory: () => new MyService('no-injector')});
}
class MyComponent {
constructor(public myService: MyService) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['my-component']],
factory: () => new MyComponent(ΔdirectiveInject(MyService)),
factory: () => new MyComponent(ɵɵdirectiveInject(MyService)),
consts: 1,
vars: 1,
template: function(fs: RenderFlags, ctx: MyComponent) {
if (fs & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (fs & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.myService.value));
ɵɵtextBinding(0, ɵɵbind(ctx.myService.value));
}
}
});
}
class MyModule {
static ngInjectorDef = ΔdefineInjector({
static ngInjectorDef = ɵɵdefineInjector({
factory: () => new MyModule(),
providers: [{provide: MyService, useValue: new MyService('injector')}]
});
@ -113,7 +113,7 @@ describe('component', () => {
// @Input
name = '';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -121,10 +121,10 @@ describe('component', () => {
vars: 1,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.name));
ɵɵtextBinding(0, ɵɵbind(ctx.name));
}
},
inputs: {name: 'name'}
@ -135,10 +135,10 @@ describe('component', () => {
// with a very large view
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(4097, 'comp');
ɵɵelement(4097, 'comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(4097, 'name', Δbind(ctx.name));
ɵɵelementProperty(4097, 'name', ɵɵbind(ctx.name));
}
}, 4098, 1, [Comp]);
@ -157,16 +157,16 @@ it('should not invoke renderer destroy method for embedded views', () => {
function MyComponent_div_Template_2(rf: any, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δtext(1, 'Child view');
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵtext(1, 'Child view');
ɵɵelementEnd();
}
}
class Comp {
visible = true;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
consts: 3,
@ -182,13 +182,14 @@ it('should not invoke renderer destroy method for embedded views', () => {
*/
template: function(rf: RenderFlags, ctx: Comp) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δtext(1, 'Root view');
ΔelementEnd();
Δtemplate(2, MyComponent_div_Template_2, 2, 0, 'div', [AttributeMarker.Template, 'ngIf']);
ɵɵelementStart(0, 'div');
ɵɵtext(1, 'Root view');
ɵɵelementEnd();
ɵɵtemplate(
2, MyComponent_div_Template_2, 2, 0, 'div', [AttributeMarker.Template, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(2, 'ngIf', Δbind(ctx.visible));
ɵɵelementProperty(2, 'ngIf', ɵɵbind(ctx.visible));
}
}
});
@ -215,32 +216,32 @@ describe('component with a container', () => {
function showItems(rf: RenderFlags, ctx: {items: string[]}) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
for (const item of ctx.items) {
const rf0 = ΔembeddedViewStart(0, 1, 1);
const rf0 = ɵɵembeddedViewStart(0, 1, 1);
{
if (rf0 & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf0 & RenderFlags.Update) {
ΔtextBinding(0, Δbind(item));
ɵɵtextBinding(0, ɵɵbind(item));
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
class WrapperComponent {
// TODO(issue/24571): remove '!'.
items !: string[];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: WrapperComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['wrapper']],
@ -248,16 +249,16 @@ describe('component with a container', () => {
vars: 0,
template: function ChildComponentTemplate(rf: RenderFlags, ctx: {items: string[]}) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
const rf0 = ΔembeddedViewStart(0, 1, 0);
const rf0 = ɵɵembeddedViewStart(0, 1, 0);
{ showItems(rf0, {items: ctx.items}); }
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
},
factory: () => new WrapperComponent,
@ -267,10 +268,10 @@ describe('component with a container', () => {
function template(rf: RenderFlags, ctx: {items: string[]}) {
if (rf & RenderFlags.Create) {
Δelement(0, 'wrapper');
ɵɵelement(0, 'wrapper');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'items', Δbind(ctx.items));
ɵɵelementProperty(0, 'items', ɵɵbind(ctx.items));
}
}
@ -290,7 +291,7 @@ describe('component with a container', () => {
// root)
describe('encapsulation', () => {
class WrapperComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: WrapperComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['wrapper']],
@ -298,7 +299,7 @@ describe('encapsulation', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: WrapperComponent) {
if (rf & RenderFlags.Create) {
Δelement(0, 'encapsulated');
ɵɵelement(0, 'encapsulated');
}
},
factory: () => new WrapperComponent,
@ -307,15 +308,15 @@ describe('encapsulation', () => {
}
class EncapsulatedComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: EncapsulatedComponent,
selectors: [['encapsulated']],
consts: 2,
vars: 0,
template: function(rf: RenderFlags, ctx: EncapsulatedComponent) {
if (rf & RenderFlags.Create) {
Δtext(0, 'foo');
Δelement(1, 'leaf');
ɵɵtext(0, 'foo');
ɵɵelement(1, 'leaf');
}
},
factory: () => new EncapsulatedComponent,
@ -327,7 +328,7 @@ describe('encapsulation', () => {
}
class LeafComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: LeafComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['leaf']],
@ -335,9 +336,9 @@ describe('encapsulation', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: LeafComponent) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1, 'bar'); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1, 'bar'); }
ɵɵelementEnd();
}
},
factory: () => new LeafComponent,
@ -360,14 +361,14 @@ describe('encapsulation', () => {
it('should encapsulate host and children with different attributes', () => {
class WrapperComponentWith {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: WrapperComponentWith,
selectors: [['wrapper']],
consts: 1,
vars: 0,
template: function(rf: RenderFlags, ctx: WrapperComponentWith) {
if (rf & RenderFlags.Create) {
Δelement(0, 'leaf');
ɵɵelement(0, 'leaf');
}
},
factory: () => new WrapperComponentWith,
@ -379,16 +380,16 @@ describe('encapsulation', () => {
}
class LeafComponentwith {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: LeafComponentwith,
selectors: [['leaf']],
consts: 2,
vars: 0,
template: function(rf: RenderFlags, ctx: LeafComponentwith) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1, 'bar'); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1, 'bar'); }
ɵɵelementEnd();
}
},
factory: () => new LeafComponentwith,
@ -438,7 +439,7 @@ describe('recursive components', () => {
ngOnDestroy() { events.push('destroy' + this.data.value); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: TreeComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['tree-comp']],
@ -447,40 +448,40 @@ describe('recursive components', () => {
vars: 1,
template: (rf: RenderFlags, ctx: TreeComponent) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δcontainer(1);
Δcontainer(2);
ɵɵtext(0);
ɵɵcontainer(1);
ɵɵcontainer(2);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.data.value));
ΔcontainerRefreshStart(1);
ɵɵtextBinding(0, ɵɵbind(ctx.data.value));
ɵɵcontainerRefreshStart(1);
{
if (ctx.data.left != null) {
let rf0 = ΔembeddedViewStart(0, 1, 1);
let rf0 = ɵɵembeddedViewStart(0, 1, 1);
if (rf0 & RenderFlags.Create) {
Δelement(0, 'tree-comp');
ɵɵelement(0, 'tree-comp');
}
if (rf0 & RenderFlags.Update) {
ΔelementProperty(0, 'data', Δbind(ctx.data.left));
ɵɵelementProperty(0, 'data', ɵɵbind(ctx.data.left));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshEnd();
ɵɵcontainerRefreshStart(2);
{
if (ctx.data.right != null) {
let rf0 = ΔembeddedViewStart(0, 1, 1);
let rf0 = ɵɵembeddedViewStart(0, 1, 1);
if (rf0 & RenderFlags.Create) {
Δelement(0, 'tree-comp');
ɵɵelement(0, 'tree-comp');
}
if (rf0 & RenderFlags.Update) {
ΔelementProperty(0, 'data', Δbind(ctx.data.right));
ɵɵelementProperty(0, 'data', ɵɵbind(ctx.data.right));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
},
inputs: {data: 'data'}
@ -502,7 +503,7 @@ describe('recursive components', () => {
ngOnDestroy() { events.push('destroy' + this.data.value); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: NgIfTree,
encapsulation: ViewEncapsulation.None,
selectors: [['ng-if-tree']],
@ -512,18 +513,18 @@ describe('recursive components', () => {
template: (rf: RenderFlags, ctx: NgIfTree) => {
if (rf & RenderFlags.Create) {
Δtext(0);
Δtemplate(
ɵɵtext(0);
ɵɵtemplate(
1, IfTemplate, 1, 1, 'ng-if-tree',
[AttributeMarker.Bindings, 'data', AttributeMarker.Template, 'ngIf']);
Δtemplate(
ɵɵtemplate(
2, IfTemplate2, 1, 1, 'ng-if-tree',
[AttributeMarker.Bindings, 'data', AttributeMarker.Template, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δbind(ctx.data.value));
ΔelementProperty(1, 'ngIf', Δbind(ctx.data.left));
ΔelementProperty(2, 'ngIf', Δbind(ctx.data.right));
ɵɵtextBinding(0, ɵɵbind(ctx.data.value));
ɵɵelementProperty(1, 'ngIf', ɵɵbind(ctx.data.left));
ɵɵelementProperty(2, 'ngIf', ɵɵbind(ctx.data.right));
}
},
@ -533,23 +534,23 @@ describe('recursive components', () => {
function IfTemplate(rf: RenderFlags, left: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'ng-if-tree');
ΔelementEnd();
ɵɵelementStart(0, 'ng-if-tree');
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const parent = ΔnextContext();
ΔelementProperty(0, 'data', Δbind(parent.data.left));
const parent = ɵɵnextContext();
ɵɵelementProperty(0, 'data', ɵɵbind(parent.data.left));
}
}
function IfTemplate2(rf: RenderFlags, right: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'ng-if-tree');
ΔelementEnd();
ɵɵelementStart(0, 'ng-if-tree');
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const parent = ΔnextContext();
ΔelementProperty(0, 'data', Δbind(parent.data.right));
const parent = ɵɵnextContext();
ɵɵelementProperty(0, 'data', ɵɵbind(parent.data.right));
}
}
@ -582,19 +583,19 @@ describe('recursive components', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
if (!ctx.skipContent) {
const rf0 = ΔembeddedViewStart(0, 1, 0);
const rf0 = ɵɵembeddedViewStart(0, 1, 0);
if (rf0 & RenderFlags.Create) {
ΔelementStart(0, 'tree-comp');
ΔelementEnd();
ɵɵelementStart(0, 'tree-comp');
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 1, 0, [TreeComponent]);
@ -616,19 +617,19 @@ describe('recursive components', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
if (!ctx.skipContent) {
const rf0 = ΔembeddedViewStart(0, 1, 0);
const rf0 = ɵɵembeddedViewStart(0, 1, 0);
if (rf0 & RenderFlags.Create) {
ΔelementStart(0, 'ng-if-tree');
ΔelementEnd();
ɵɵelementStart(0, 'ng-if-tree');
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 1, 0, [NgIfTree]);
@ -647,7 +648,7 @@ describe('recursive components', () => {
class TestInputsComponent {
// TODO(issue/24571): remove '!'.
minifiedName !: string;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: TestInputsComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['test-inputs']],
@ -676,7 +677,7 @@ describe('view destruction', () => {
let wasOnDestroyCalled = false;
class ComponentWithOnDestroy {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
selectors: [['comp-with-destroy']],
type: ComponentWithOnDestroy,
consts: 0,
@ -694,7 +695,7 @@ describe('view destruction', () => {
// when the view tree is torn down following the destruction of that root view.
const ComponentWithChildOnDestroy = createComponent('test-app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'comp-with-destroy');
ɵɵelement(0, 'comp-with-destroy');
}
}, 1, 0, [ComponentWithOnDestroy], [], null, [], []);

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ΔdefineComponent} from '../../src/render3/definition';
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {ɵɵdefineComponent} from '../../src/render3/definition';
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {ComponentFixture, TemplateFixture, createComponent} from './render_util';
@ -16,29 +16,29 @@ describe('JS control flow', () => {
it('should work with if block', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(1, 2, 1);
let rf1 = ɵɵembeddedViewStart(1, 2, 1);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔtextBinding(1, Δbind(ctx.message));
ɵɵtextBinding(1, ɵɵbind(ctx.message));
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2);
@ -72,41 +72,41 @@ describe('JS control flow', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(1, 2, 0);
let rf1 = ɵɵembeddedViewStart(1, 2, 0);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition2) {
let rf2 = ΔembeddedViewStart(2, 1, 0);
let rf2 = ɵɵembeddedViewStart(2, 1, 0);
{
if (rf2 & RenderFlags.Create) {
Δtext(0, 'Hello');
ɵɵtext(0, 'Hello');
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2);
@ -164,51 +164,51 @@ describe('JS control flow', () => {
* % }
* % }
*/
function createTemplate() { Δcontainer(0); }
function createTemplate() { ɵɵcontainer(0); }
function updateTemplate() {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(1, 2, 0);
let rf1 = ɵɵembeddedViewStart(1, 2, 0);
{
if (rf1 & RenderFlags.Create) {
{ Δcontainer(0); }
{ Δcontainer(1); }
{ ɵɵcontainer(0); }
{ ɵɵcontainer(1); }
}
if (rf1 & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition2) {
let rf2 = ΔembeddedViewStart(2, 1, 0);
let rf2 = ɵɵembeddedViewStart(2, 1, 0);
{
if (rf2 & RenderFlags.Create) {
Δtext(0, 'Hello');
ɵɵtext(0, 'Hello');
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshEnd();
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition3) {
let rf2 = ΔembeddedViewStart(2, 1, 0);
let rf2 = ɵɵembeddedViewStart(2, 1, 0);
{
if (rf2 & RenderFlags.Create) {
Δtext(0, 'World');
ɵɵtext(0, 'World');
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
const fixture = new TemplateFixture(createTemplate, updateTemplate, 1);
@ -231,32 +231,32 @@ describe('JS control flow', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
if (ctx.condition1) {
const rf1 = ΔembeddedViewStart(1, 1, 0);
const rf1 = ɵɵembeddedViewStart(1, 1, 0);
if (rf1 & RenderFlags.Create) {
Δtext(0, '1');
ɵɵtext(0, '1');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
} // can't have ; here due linting rules
if (ctx.condition2) {
const rf2 = ΔembeddedViewStart(2, 1, 0);
const rf2 = ɵɵembeddedViewStart(2, 1, 0);
if (rf2 & RenderFlags.Create) {
Δtext(0, '2');
ɵɵtext(0, '2');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
} // can't have ; here due linting rules
if (ctx.condition3) {
const rf3 = ΔembeddedViewStart(3, 1, 0);
const rf3 = ɵɵembeddedViewStart(3, 1, 0);
if (rf3 & RenderFlags.Create) {
Δtext(0, '3');
ɵɵtext(0, '3');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 1);
@ -275,40 +275,40 @@ describe('JS control flow', () => {
it('should work with containers with views as parents', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtext(1, 'hello'); }
ΔelementEnd();
Δcontainer(2);
ɵɵelementStart(0, 'div');
{ ɵɵtext(1, 'hello'); }
ɵɵelementEnd();
ɵɵcontainer(2);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshStart(2);
{
if (ctx.condition1) {
let rf0 = ΔembeddedViewStart(0, 1, 0);
let rf0 = ɵɵembeddedViewStart(0, 1, 0);
{
if (rf0 & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf0 & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition2) {
let rf0 = ΔembeddedViewStart(0, 1, 0);
let rf0 = ɵɵembeddedViewStart(0, 1, 0);
{
if (rf0 & RenderFlags.Create) {
Δtext(0, 'world');
ɵɵtext(0, 'world');
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 3);
@ -328,29 +328,29 @@ describe('JS control flow', () => {
let data: string[] = ['a', 'b', 'c'];
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'ul');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'ul');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
for (let i = 0; i < data.length; i++) {
let rf1 = ΔembeddedViewStart(1, 2, 1);
let rf1 = ɵɵembeddedViewStart(1, 2, 1);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'li');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'li');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔtextBinding(1, Δbind(data[i]));
ɵɵtextBinding(1, ɵɵbind(data[i]));
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2);
@ -384,42 +384,42 @@ describe('JS control flow', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'ul');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'ul');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
for (let i = 0; i < data[0].length; i++) {
let rf1 = ΔembeddedViewStart(1, 2, 0);
let rf1 = ɵɵembeddedViewStart(1, 2, 0);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'li');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'li');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
data[1].forEach((value: string, ind: number) => {
let rf2 = ΔembeddedViewStart(2, 1, 1);
let rf2 = ɵɵembeddedViewStart(2, 1, 1);
if (rf2 & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf2 & RenderFlags.Update) {
ΔtextBinding(0, Δbind(data[0][i] + value));
ɵɵtextBinding(0, ɵɵbind(data[0][i] + value));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
});
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2);
@ -453,49 +453,49 @@ describe('JS control flow', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ɵɵelementStart(0, 'div');
{
Δtext(1, 'Before');
Δcontainer(2);
Δtext(3, 'After');
ɵɵtext(1, 'Before');
ɵɵcontainer(2);
ɵɵtext(3, 'After');
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshStart(2);
{
for (let i = 0; i < cafes.length; i++) {
let rf1 = ΔembeddedViewStart(1, 4, 1);
let rf1 = ɵɵembeddedViewStart(1, 4, 1);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'h2');
{ Δtext(1); }
ΔelementEnd();
Δcontainer(2);
Δtext(3, '-');
ɵɵelementStart(0, 'h2');
{ ɵɵtext(1); }
ɵɵelementEnd();
ɵɵcontainer(2);
ɵɵtext(3, '-');
}
if (rf1 & RenderFlags.Update) {
ΔtextBinding(1, Δbind(cafes[i].name));
ΔcontainerRefreshStart(2);
ɵɵtextBinding(1, ɵɵbind(cafes[i].name));
ɵɵcontainerRefreshStart(2);
{
for (let j = 0; j < cafes[i].entrees.length; j++) {
let rf2 = ΔembeddedViewStart(2, 1, 1);
let rf2 = ɵɵembeddedViewStart(2, 1, 1);
if (rf2 & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf2 & RenderFlags.Update) {
ΔtextBinding(0, Δbind(cafes[i].entrees[j]));
ɵɵtextBinding(0, ɵɵbind(cafes[i].entrees[j]));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 4);
@ -548,68 +548,68 @@ describe('JS control flow', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ɵɵelementStart(0, 'div');
{
Δtext(1, 'Before');
Δcontainer(2);
Δtext(3, 'After');
ɵɵtext(1, 'Before');
ɵɵcontainer(2);
ɵɵtext(3, 'After');
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshStart(2);
{
for (let i = 0; i < cafes.length; i++) {
let rf1 = ΔembeddedViewStart(1, 4, 1);
let rf1 = ɵɵembeddedViewStart(1, 4, 1);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'h2');
{ Δtext(1); }
ΔelementEnd();
Δcontainer(2);
Δtext(3, '-');
ɵɵelementStart(0, 'h2');
{ ɵɵtext(1); }
ɵɵelementEnd();
ɵɵcontainer(2);
ɵɵtext(3, '-');
}
if (rf1 & RenderFlags.Update) {
ΔtextBinding(1, Δbind(cafes[i].name));
ΔcontainerRefreshStart(2);
ɵɵtextBinding(1, ɵɵbind(cafes[i].name));
ɵɵcontainerRefreshStart(2);
{
for (let j = 0; j < cafes[i].entrees.length; j++) {
let rf1 = ΔembeddedViewStart(1, 3, 1);
let rf1 = ɵɵembeddedViewStart(1, 3, 1);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'h3');
{ Δtext(1); }
ΔelementEnd();
Δcontainer(2);
ɵɵelementStart(0, 'h3');
{ ɵɵtext(1); }
ɵɵelementEnd();
ɵɵcontainer(2);
}
if (rf1 & RenderFlags.Update) {
ΔtextBinding(1, Δbind(cafes[i].entrees[j].name));
ΔcontainerRefreshStart(2);
ɵɵtextBinding(1, ɵɵbind(cafes[i].entrees[j].name));
ɵɵcontainerRefreshStart(2);
{
for (let k = 0; k < cafes[i].entrees[j].foods.length; k++) {
let rf2 = ΔembeddedViewStart(1, 1, 1);
let rf2 = ɵɵembeddedViewStart(1, 1, 1);
if (rf2 & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf2 & RenderFlags.Update) {
ΔtextBinding(0, Δbind(cafes[i].entrees[j].foods[k]));
ɵɵtextBinding(0, ɵɵbind(cafes[i].entrees[j].foods[k]));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 4);
@ -632,36 +632,36 @@ describe('JS control flow', () => {
it('should work with if/else blocks', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(1, 2, 0);
let rf1 = ɵɵembeddedViewStart(1, 2, 0);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1, 'Hello'); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1, 'Hello'); }
ɵɵelementEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
} else {
let rf2 = ΔembeddedViewStart(2, 2, 0);
let rf2 = ɵɵembeddedViewStart(2, 2, 0);
{
if (rf2) {
ΔelementStart(0, 'div');
{ Δtext(1, 'Goodbye'); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtext(1, 'Goodbye'); }
ɵɵelementEnd();
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2);
@ -685,7 +685,7 @@ describe('JS control flow', () => {
// Intentionally duplicating the templates in test below so we are
// testing the behavior on firstTemplatePass for each of these tests
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
consts: 0,
@ -702,7 +702,7 @@ describe('JS control flow', () => {
condition = true;
condition2 = true;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: App,
selectors: [['app']],
factory: () => new App(),
@ -710,33 +710,33 @@ describe('JS control flow', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div');
Δcontainer(1);
Δcontainer(2);
ɵɵelement(0, 'div');
ɵɵcontainer(1);
ɵɵcontainer(2);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshEnd();
ɵɵcontainerRefreshStart(2);
{
if (ctx.condition2) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
},
directives: () => [Comp]
@ -753,7 +753,7 @@ describe('JS control flow', () => {
// Intentionally duplicating the templates from above so we are
// testing the behavior on firstTemplatePass for each of these tests
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
consts: 0,
@ -770,7 +770,7 @@ describe('JS control flow', () => {
condition = false;
condition2 = true;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: App,
selectors: [['app']],
factory: () => new App(),
@ -778,33 +778,33 @@ describe('JS control flow', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div');
Δcontainer(1);
Δcontainer(2);
ɵɵelement(0, 'div');
ɵɵcontainer(1);
ɵɵcontainer(2);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshEnd();
ɵɵcontainerRefreshStart(2);
{
if (ctx.condition2) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
},
directives: () => [Comp]
@ -835,35 +835,35 @@ describe('JS for loop', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
for (let i = 0; i < config.data1.length; i++) {
let rf2 = ΔembeddedViewStart(1, 1, 1);
let rf2 = ɵɵembeddedViewStart(1, 1, 1);
if (rf2 & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf2 & RenderFlags.Update) {
ΔtextBinding(0, Δbind(config.data1[i]));
ɵɵtextBinding(0, ɵɵbind(config.data1[i]));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
for (let j = 0; j < config.data2.length; j++) {
let rf2 = ΔembeddedViewStart(1, 1, 1);
let rf2 = ɵɵembeddedViewStart(1, 1, 1);
if (rf2 & RenderFlags.Create) {
Δtext(0);
ɵɵtext(0);
}
if (rf2 & RenderFlags.Update) {
ΔtextBinding(0, Δbind(config.data2[j]));
ɵɵtextBinding(0, ɵɵbind(config.data2[j]));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2);
@ -891,41 +891,41 @@ describe('function calls', () => {
function spanify(rf: RenderFlags, ctx: {message: string | null}) {
const message = ctx.message;
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'span');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔtextBinding(1, Δbind(message));
ɵɵtextBinding(1, ɵɵbind(message));
}
}
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ɵɵelementStart(0, 'div');
{
Δtext(1, 'Before');
Δcontainer(2);
Δcontainer(3);
Δtext(4, 'After');
ɵɵtext(1, 'Before');
ɵɵcontainer(2);
ɵɵcontainer(3);
ɵɵtext(4, 'After');
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshStart(2);
{
let rf0 = ΔembeddedViewStart(0, 2, 1);
let rf0 = ɵɵembeddedViewStart(0, 2, 1);
{ spanify(rf0, {message: data[0]}); }
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
ΔcontainerRefreshEnd();
ΔcontainerRefreshStart(3);
ɵɵcontainerRefreshEnd();
ɵɵcontainerRefreshStart(3);
{
let rf0 = ΔembeddedViewStart(0, 2, 1);
let rf0 = ɵɵembeddedViewStart(0, 2, 1);
{ spanify(rf0, {message: data[1]}); }
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 5);

View File

@ -8,14 +8,14 @@
import {getLContext} from '../../src/render3/context_discovery';
import {LViewDebug, toDebug} from '../../src/render3/debug';
import {RenderFlags, ΔdefineComponent, ΔelementEnd, ΔelementStart, Δtext} from '../../src/render3/index';
import {RenderFlags, ɵɵdefineComponent, ɵɵelementEnd, ɵɵelementStart, ɵɵtext} from '../../src/render3/index';
import {ComponentFixture} from './render_util';
describe('Debug Representation', () => {
it('should generate a human readable version', () => {
class MyComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['my-comp']],
vars: 0,
@ -23,9 +23,9 @@ describe('Debug Representation', () => {
factory: () => new MyComponent(),
template: function(rf: RenderFlags, ctx: MyComponent) {
if (rf == RenderFlags.Create) {
ΔelementStart(0, 'div', ['id', '123']);
Δtext(1, 'Hello World');
ΔelementEnd();
ɵɵelementStart(0, 'div', ['id', '123']);
ɵɵtext(1, 'Hello World');
ɵɵelementEnd();
}
}
});

File diff suppressed because it is too large Load Diff

View File

@ -8,8 +8,8 @@
import {EventEmitter, TemplateRef, ViewContainerRef} from '@angular/core';
import {AttributeMarker, RenderFlags, ΔdefineComponent, ΔdefineDirective, ΔdirectiveInject} from '../../src/render3/index';
import {Δbind, Δelement, ΔelementContainerEnd, ΔelementContainerStart, ΔelementEnd, ΔelementProperty, ΔelementStart, Δlistener, Δtemplate, Δtext} from '../../src/render3/instructions/all';
import {AttributeMarker, RenderFlags, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdirectiveInject} from '../../src/render3/index';
import {ɵɵbind, ɵɵelement, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵlistener, ɵɵtemplate, ɵɵtext} from '../../src/render3/instructions/all';
import {NgIf} from './common_with_def';
import {ComponentFixture, TemplateFixture, createComponent} from './render_util';
@ -22,7 +22,7 @@ describe('directive', () => {
let directiveInstance: Directive;
class Directive {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Directive,
selectors: [['', 'test', '']],
factory: () => directiveInstance = new Directive,
@ -52,10 +52,10 @@ describe('directive', () => {
*/
function createTemplate() {
// using 2 bindings to show example shape of attributes array
Δelement(0, 'span', ['class', 'fade', AttributeMarker.Bindings, 'test', 'other']);
ɵɵelement(0, 'span', ['class', 'fade', AttributeMarker.Bindings, 'test', 'other']);
}
function updateTemplate() { ΔelementProperty(0, 'test', Δbind(false)); }
function updateTemplate() { ɵɵelementProperty(0, 'test', ɵɵbind(false)); }
const fixture = new TemplateFixture(createTemplate, updateTemplate, 1, 1, [Directive]);
@ -70,7 +70,7 @@ describe('directive', () => {
let directiveInstance: Directive;
class Directive {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Directive,
selectors: [['', 'test', '']],
factory: () => directiveInstance = new Directive,
@ -103,14 +103,14 @@ describe('directive', () => {
*/
function createTemplate() {
// putting name (test) in the "usual" value position
Δelement(
ɵɵelement(
0, 'span', ['class', 'fade', AttributeMarker.Bindings, 'prop1', 'test', 'prop2']);
}
function updateTemplate() {
ΔelementProperty(0, 'prop1', Δbind(true));
ΔelementProperty(0, 'test', Δbind(false));
ΔelementProperty(0, 'prop2', Δbind(true));
ɵɵelementProperty(0, 'prop1', ɵɵbind(true));
ɵɵelementProperty(0, 'test', ɵɵbind(false));
ɵɵelementProperty(0, 'prop2', ɵɵbind(true));
}
const fixture = new TemplateFixture(createTemplate, updateTemplate, 1, 3, [Directive]);
@ -133,20 +133,20 @@ describe('directive', () => {
let tmplRef: any;
class DirectiveA {
constructor(public templateRef: any) { tmplRef = templateRef; }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: DirectiveA,
selectors: [['ng-template', 'directiveA', '']],
factory: () => new DirectiveA(ΔdirectiveInject(TemplateRef as any))
factory: () => new DirectiveA(ɵɵdirectiveInject(TemplateRef as any))
});
}
function MyComponent_ng_template_Template_0(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0, 'Some content');
ɵɵtext(0, 'Some content');
}
}
class MyComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['my-component']],
factory: () => new MyComponent(),
@ -155,7 +155,7 @@ describe('directive', () => {
// <ng-template directiveA>Some content</ng-template>
template: function MyComponent_Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(
ɵɵtemplate(
0, MyComponent_ng_template_Template_0, 1, 0, 'ng-template', ['directiveA', '']);
}
},
@ -179,24 +179,24 @@ describe('directive', () => {
let vcRef: any;
class DirectiveA {
constructor(public viewContainerRef: any) { vcRef = viewContainerRef; }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: DirectiveA,
selectors: [['ng-container', 'directiveA', '']],
factory: () => new DirectiveA(ΔdirectiveInject(ViewContainerRef as any))
factory: () => new DirectiveA(ɵɵdirectiveInject(ViewContainerRef as any))
});
}
function MyComponent_ng_container_Template_0(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementContainerStart(0, ['directiveA', '']);
Δtext(1, 'Some content');
ΔelementContainerEnd();
ɵɵelementContainerStart(0, ['directiveA', '']);
ɵɵtext(1, 'Some content');
ɵɵelementContainerEnd();
}
}
class MyComponent {
visible = true;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['my-component']],
factory: () => new MyComponent(),
@ -205,12 +205,12 @@ describe('directive', () => {
// <ng-container *ngIf="visible" directiveA>Some content</ng-container>
template: function MyComponent_Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(
ɵɵtemplate(
0, MyComponent_ng_container_Template_0, 2, 0, 'ng-container',
['directiveA', '', AttributeMarker.Template, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngIf', Δbind(ctx.visible));
ɵɵelementProperty(0, 'ngIf', ɵɵbind(ctx.visible));
}
},
directives: [DirectiveA, NgIf]
@ -225,7 +225,7 @@ describe('directive', () => {
let directiveInstance: Directive;
class Directive {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Directive,
selectors: [['', 'out', '']],
factory: () => directiveInstance = new Directive,
@ -239,9 +239,9 @@ describe('directive', () => {
* <span (out)="someVar = true"></span>
*/
function createTemplate() {
ΔelementStart(0, 'span', [AttributeMarker.Bindings, 'out']);
{ Δlistener('out', () => {}); }
ΔelementEnd();
ɵɵelementStart(0, 'span', [AttributeMarker.Bindings, 'out']);
{ ɵɵlistener('out', () => {}); }
ɵɵelementEnd();
}
const fixture = new TemplateFixture(createTemplate, () => {}, 1, 0, [Directive]);
@ -257,7 +257,7 @@ describe('directive', () => {
let directiveInstance: Directive;
class Directive {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Directive,
selectors: [['', 'out', '']],
factory: () => directiveInstance = new Directive,
@ -273,8 +273,8 @@ describe('directive', () => {
*/
const Cmpt = createComponent('Cmpt', function(rf: RenderFlags, ctx: {value: any}) {
if (rf & RenderFlags.Create) {
Δtemplate(0, null, 0, 0, 'ng-template', [AttributeMarker.Bindings, 'out']);
Δlistener('out', () => { ctx.value = true; });
ɵɵtemplate(0, null, 0, 0, 'ng-template', [AttributeMarker.Bindings, 'out']);
ɵɵlistener('out', () => { ctx.value = true; });
}
}, 1, 0, [Directive]);
@ -294,11 +294,11 @@ describe('directive', () => {
*/
const Cmpt = createComponent('Cmpt', function(rf: RenderFlags, ctx: {value: any}) {
if (rf & RenderFlags.Create) {
ΔelementContainerStart(0, [AttributeMarker.Bindings, 'out']);
ɵɵelementContainerStart(0, [AttributeMarker.Bindings, 'out']);
{
Δlistener('out', () => { ctx.value = true; });
ɵɵlistener('out', () => { ctx.value = true; });
}
ΔelementContainerEnd();
ɵɵelementContainerEnd();
}
}, 1, 0, [Directive]);

View File

@ -7,8 +7,8 @@
*/
import {StaticInjector} from '../../src/di/injector';
import {createInjector} from '../../src/di/r3_injector';
import {AttributeMarker, RenderFlags, getHostElement, ΔProvidersFeature, ΔdefineComponent, ΔdefineDirective, ΔelementContainerEnd, ΔelementContainerStart, Δi18n, Δi18nApply, Δi18nExp} from '../../src/render3/index';
import {markDirty, Δbind, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔelementStyling, ΔelementStylingApply, Δlistener, Δtemplate, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {AttributeMarker, RenderFlags, getHostElement, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵi18n, ɵɵi18nApply, ɵɵi18nExp} from '../../src/render3/index';
import {markDirty, ɵɵbind, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵelementStyling, ɵɵelementStylingApply, ɵɵlistener, ɵɵtemplate, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {getComponent, getContext, getDirectives, getInjectionTokens, getInjector, getListeners, getLocalRefs, getRootComponents, getViewComponent, loadLContext} from '../../src/render3/util/discovery_utils';
import {NgIf} from './common_with_def';
@ -68,7 +68,7 @@ describe('discovery utils', () => {
class Child {
constructor() { childComponent.push(this); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Child,
selectors: [['child']],
factory: () => new Child(),
@ -76,17 +76,17 @@ describe('discovery utils', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Child) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'p');
ɵɵelement(0, 'p');
}
},
features: [ΔProvidersFeature([{provide: String, useValue: 'Child'}])]
features: [ɵɵProvidersFeature([{provide: String, useValue: 'Child'}])]
});
}
class DirectiveA {
constructor() { dirA.push(this); }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: DirectiveA,
selectors: [['', 'dirA', '']],
exportAs: ['dirA'],
@ -102,7 +102,7 @@ describe('discovery utils', () => {
text: string = 'INIT';
constructor() { myApp = this; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyApp,
selectors: [['my-app']],
factory: () => new MyApp(),
@ -111,30 +111,30 @@ describe('discovery utils', () => {
directives: [Child, DirectiveA, NgIf],
template: (rf: RenderFlags, ctx: MyApp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span');
Δlistener('click', $event => log.push($event));
Δtext(1);
ΔelementEnd();
Δelement(2, 'div', ['dirA', ''], ['div', '', 'foo', 'dirA']);
Δelement(5, 'child');
Δelement(6, 'child', ['dirA', ''], ['child', '']);
Δtemplate(8, function(rf: RenderFlags, ctx: never) {
ɵɵelementStart(0, 'span');
ɵɵlistener('click', $event => log.push($event));
ɵɵtext(1);
ɵɵelementEnd();
ɵɵelement(2, 'div', ['dirA', ''], ['div', '', 'foo', 'dirA']);
ɵɵelement(5, 'child');
ɵɵelement(6, 'child', ['dirA', ''], ['child', '']);
ɵɵtemplate(8, function(rf: RenderFlags, ctx: never) {
if (rf & RenderFlags.Create) {
Δelement(0, 'child');
ɵɵelement(0, 'child');
}
}, 1, 0, 'child', ['dirA', AttributeMarker.Template, 'ngIf']);
ΔelementStart(9, 'i18n');
Δi18n(10, MSG_DIV);
ΔelementEnd();
ΔelementContainerStart(11);
{ Δtext(12, 'content'); }
ΔelementContainerEnd();
ɵɵelementStart(9, 'i18n');
ɵɵi18n(10, MSG_DIV);
ɵɵelementEnd();
ɵɵelementContainerStart(11);
{ ɵɵtext(12, 'content'); }
ɵɵelementContainerEnd();
}
if (rf & RenderFlags.Update) {
ΔtextBinding(1, Δbind(ctx.text));
ΔelementProperty(8, 'ngIf', Δbind(true));
Δi18nExp(Δbind(ctx.text));
Δi18nApply(10);
ɵɵtextBinding(1, ɵɵbind(ctx.text));
ɵɵelementProperty(8, 'ngIf', ɵɵbind(true));
ɵɵi18nExp(ɵɵbind(ctx.text));
ɵɵi18nApply(10);
}
}
});
@ -348,7 +348,7 @@ describe('discovery utils deprecated', () => {
let innerComp: InnerComp;
class InnerComp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: InnerComp,
selectors: [['inner-comp']],
factory: () => innerComp = new InnerComp(),
@ -356,14 +356,14 @@ describe('discovery utils deprecated', () => {
vars: 0,
template: (rf: RenderFlags, ctx: InnerComp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div');
ɵɵelement(0, 'div');
}
}
});
}
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -371,7 +371,7 @@ describe('discovery utils deprecated', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'inner-comp');
ɵɵelement(0, 'inner-comp');
}
},
directives: [InnerComp]
@ -399,7 +399,7 @@ describe('discovery utils deprecated', () => {
let myDir3Instance: MyDir2|null = null;
class MyDir1 {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir1,
selectors: [['', 'my-dir-1', '']],
factory: () => myDir1Instance = new MyDir1()
@ -407,7 +407,7 @@ describe('discovery utils deprecated', () => {
}
class MyDir2 {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir2,
selectors: [['', 'my-dir-2', '']],
factory: () => myDir2Instance = new MyDir2()
@ -415,7 +415,7 @@ describe('discovery utils deprecated', () => {
}
class MyDir3 {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir3,
selectors: [['', 'my-dir-3', '']],
factory: () => myDir3Instance = new MyDir2()
@ -423,7 +423,7 @@ describe('discovery utils deprecated', () => {
}
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -431,8 +431,8 @@ describe('discovery utils deprecated', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['my-dir-1', '', 'my-dir-2', '']);
Δelement(1, 'div', ['my-dir-3']);
ɵɵelement(0, 'div', ['my-dir-1', '', 'my-dir-2', '']);
ɵɵelement(1, 'div', ['my-dir-3']);
}
},
directives: [MyDir1, MyDir2, MyDir3]
@ -461,7 +461,7 @@ describe('discovery utils deprecated', () => {
it('should return an injector that can return directive instances', () => {
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -481,7 +481,7 @@ describe('discovery utils deprecated', () => {
it('should return an injector that falls-back to a module injector', () => {
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -506,7 +506,7 @@ describe('discovery utils deprecated', () => {
it('should return a map of local refs for an element', () => {
class MyDir {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir,
selectors: [['', 'myDir', '']],
exportAs: ['myDir'],
@ -515,7 +515,7 @@ describe('discovery utils deprecated', () => {
}
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -524,7 +524,7 @@ describe('discovery utils deprecated', () => {
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
// <div myDir #elRef #dirRef="myDir">
Δelement(0, 'div', ['myDir'], ['elRef', '', 'dirRef', 'myDir']);
ɵɵelement(0, 'div', ['myDir'], ['elRef', '', 'dirRef', 'myDir']);
}
},
directives: [MyDir]
@ -543,7 +543,7 @@ describe('discovery utils deprecated', () => {
it('should return a map of local refs for an element with styling context', () => {
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -552,11 +552,11 @@ describe('discovery utils deprecated', () => {
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
// <div #elRef class="fooClass">
ΔelementStart(0, 'div', null, ['elRef', '']);
ΔelementEnd();
ɵɵelementStart(0, 'div', null, ['elRef', '']);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStylingApply(0);
ɵɵelementStylingApply(0);
}
}
});

View File

@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {AttributeMarker, ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index';
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementAttribute, ΔelementClassProp, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔelementStyling, ΔelementStylingApply, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation2, ΔnextContext, Δreference, Δtemplate, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {AttributeMarker, ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index';
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementAttribute, ɵɵelementClassProp, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵelementStyling, ɵɵelementStylingApply, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation2, ɵɵnextContext, ɵɵreference, ɵɵtemplate, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {NgIf} from './common_with_def';
@ -21,12 +21,12 @@ describe('exports', () => {
/** {{ myInput.value}} <input value="one" #myInput> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'input', ['value', 'one'], ['myInput', '']);
ɵɵtext(0);
ɵɵelement(1, 'input', ['value', 'one'], ['myInput', '']);
}
if (rf & RenderFlags.Update) {
const tmp = Δreference(2) as any;
ΔtextBinding(0, Δbind(tmp.value));
const tmp = ɵɵreference(2) as any;
ɵɵtextBinding(0, ɵɵbind(tmp.value));
}
}, 3, 1);
@ -39,12 +39,12 @@ describe('exports', () => {
/** <div [title]="myInput.value"</div> <input value="one" #myInput> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div');
Δelement(1, 'input', ['value', 'one'], ['myInput', '']);
ɵɵelement(0, 'div');
ɵɵelement(1, 'input', ['value', 'one'], ['myInput', '']);
}
if (rf & RenderFlags.Update) {
const tmp = Δreference(2) as any;
ΔelementProperty(0, 'title', Δbind(tmp.value));
const tmp = ɵɵreference(2) as any;
ɵɵelementProperty(0, 'title', ɵɵbind(tmp.value));
}
}, 3, 1);
@ -56,12 +56,12 @@ describe('exports', () => {
/** <div [attr.aria-label]="myInput.value"</div> <input value="one" #myInput> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div');
Δelement(1, 'input', ['value', 'one'], ['myInput', '']);
ɵɵelement(0, 'div');
ɵɵelement(1, 'input', ['value', 'one'], ['myInput', '']);
}
if (rf & RenderFlags.Update) {
const tmp = Δreference(2) as any;
ΔelementAttribute(0, 'aria-label', Δbind(tmp.value));
const tmp = ɵɵreference(2) as any;
ɵɵelementAttribute(0, 'aria-label', ɵɵbind(tmp.value));
}
}, 3, 1);
@ -73,15 +73,15 @@ describe('exports', () => {
/** <div [class.red]="myInput.checked"</div> <input type="checkbox" checked #myInput> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div', [AttributeMarker.Classes, 'red']);
ΔelementStyling(['red']);
ΔelementEnd();
Δelement(1, 'input', ['type', 'checkbox', 'checked', 'true'], ['myInput', '']);
ɵɵelementStart(0, 'div', [AttributeMarker.Classes, 'red']);
ɵɵelementStyling(['red']);
ɵɵelementEnd();
ɵɵelement(1, 'input', ['type', 'checkbox', 'checked', 'true'], ['myInput', '']);
}
if (rf & RenderFlags.Update) {
const tmp = Δreference(2) as any;
ΔelementClassProp(0, 0, tmp.checked);
ΔelementStylingApply(0);
const tmp = ɵɵreference(2) as any;
ɵɵelementClassProp(0, 0, tmp.checked);
ɵɵelementStylingApply(0);
}
}, 3);
@ -97,7 +97,7 @@ describe('exports', () => {
class MyComponent {
constructor() { myComponent = this; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['comp']],
consts: 0,
@ -113,7 +113,7 @@ describe('exports', () => {
constructor() { myDir = this; }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir,
selectors: [['', 'myDir', '']],
factory: () => new MyDir,
@ -124,12 +124,12 @@ describe('exports', () => {
/** <div [myDir]="myComp"></div><comp #myComp></comp> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['myDir', '']);
Δelement(1, 'comp', null, ['myComp', '']);
ɵɵelement(0, 'div', ['myDir', '']);
ɵɵelement(1, 'comp', null, ['myComp', '']);
}
if (rf & RenderFlags.Update) {
const tmp = Δreference(2) as any;
ΔelementProperty(0, 'myDir', Δbind(tmp));
const tmp = ɵɵreference(2) as any;
ɵɵelementProperty(0, 'myDir', ɵɵbind(tmp));
}
}, 3, 1, [MyComponent, MyDir]);
@ -145,7 +145,7 @@ describe('exports', () => {
constructor() { myComponent = this; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComponent,
selectors: [['comp']],
consts: 0,
@ -159,16 +159,16 @@ describe('exports', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δtext(1);
Δelement(2, 'comp', null, ['myComp', '']);
Δelement(4, 'input', ['value', 'one'], ['myInput', '']);
ɵɵtext(0);
ɵɵtext(1);
ɵɵelement(2, 'comp', null, ['myComp', '']);
ɵɵelement(4, 'input', ['value', 'one'], ['myInput', '']);
}
if (rf & RenderFlags.Update) {
const tmp1 = Δreference(3) as any;
const tmp2 = Δreference(5) as any;
ΔtextBinding(0, Δbind(tmp2.value));
ΔtextBinding(1, Δbind(tmp1.name));
const tmp1 = ɵɵreference(3) as any;
const tmp2 = ɵɵreference(5) as any;
ɵɵtextBinding(0, ɵɵbind(tmp2.value));
ɵɵtextBinding(1, ɵɵbind(tmp1.name));
}
}, 6, 2, [MyComponent]);
@ -179,29 +179,29 @@ describe('exports', () => {
it('should work inside a view container', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(1, 2, 1);
let rf1 = ɵɵembeddedViewStart(1, 2, 1);
{
if (rf1 & RenderFlags.Create) {
Δtext(0);
Δelement(1, 'input', ['value', 'one'], ['myInput', '']);
ɵɵtext(0);
ɵɵelement(1, 'input', ['value', 'one'], ['myInput', '']);
}
if (rf1 & RenderFlags.Update) {
const tmp = Δreference(2) as any;
ΔtextBinding(0, Δbind(tmp.value));
const tmp = ɵɵreference(2) as any;
ɵɵtextBinding(0, ɵɵbind(tmp.value));
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2);
@ -230,48 +230,48 @@ describe('exports', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, app: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'input', ['value', 'one'], ['outerInput', '']);
ΔelementEnd();
Δtemplate(2, outerTemplate, 5, 2, 'div', [AttributeMarker.Template, 'ngIf']);
ɵɵelementStart(0, 'input', ['value', 'one'], ['outerInput', '']);
ɵɵelementEnd();
ɵɵtemplate(2, outerTemplate, 5, 2, 'div', [AttributeMarker.Template, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(2, 'ngIf', Δbind(app.outer));
ɵɵelementProperty(2, 'ngIf', ɵɵbind(app.outer));
}
}, 3, 1, [NgIf]);
function outerTemplate(rf: RenderFlags, outer: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ɵɵelementStart(0, 'div');
{
Δtext(1);
ΔelementStart(2, 'input', ['value', 'two'], ['innerInput', '']);
ΔelementEnd();
Δtemplate(4, innerTemplate, 2, 2, 'div', [AttributeMarker.Template, 'ngIf']);
ɵɵtext(1);
ɵɵelementStart(2, 'input', ['value', 'two'], ['innerInput', '']);
ɵɵelementEnd();
ɵɵtemplate(4, innerTemplate, 2, 2, 'div', [AttributeMarker.Template, 'ngIf']);
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
const app = ΔnextContext();
const outerInput = Δreference(1) as any;
ΔtextBinding(1, Δbind(outerInput.value));
ΔelementProperty(4, 'ngIf', Δbind(app.inner));
const app = ɵɵnextContext();
const outerInput = ɵɵreference(1) as any;
ɵɵtextBinding(1, ɵɵbind(outerInput.value));
ɵɵelementProperty(4, 'ngIf', ɵɵbind(app.inner));
}
}
function innerTemplate(rf: RenderFlags, inner: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δtext(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵtext(1); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔnextContext();
const innerInput = Δreference(3) as any;
ΔnextContext();
const outerInput = Δreference(1) as any;
ΔtextBinding(1, Δinterpolation2('', outerInput.value, ' - ', innerInput.value, ''));
ɵɵnextContext();
const innerInput = ɵɵreference(3) as any;
ɵɵnextContext();
const outerInput = ɵɵreference(1) as any;
ɵɵtextBinding(1, ɵɵinterpolation2('', outerInput.value, ' - ', innerInput.value, ''));
}
}

View File

@ -8,13 +8,13 @@
import {ElementRef, QueryList, ViewContainerRef} from '@angular/core';
import {AttributeMarker, ΔInheritDefinitionFeature, ΔNgOnChangesFeature, ΔProvidersFeature, ΔdefineComponent, ΔdefineDirective, Δtemplate} from '../../src/render3/index';
import {ΔallocHostVars, Δbind, ΔdirectiveInject, Δelement, ΔelementAttribute, ΔelementEnd, ΔelementHostAttrs, ΔelementHostStyleProp, ΔelementHostStyling, ΔelementHostStylingApply, ΔelementProperty, ΔelementStart, ΔelementStyleProp, ΔelementStyling, ΔelementStylingApply, Δlistener, Δload, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {AttributeMarker, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵtemplate} from '../../src/render3/index';
import {ɵɵallocHostVars, ɵɵbind, ɵɵdirectiveInject, ɵɵelement, ɵɵelementAttribute, ɵɵelementEnd, ɵɵelementHostAttrs, ɵɵelementHostStyleProp, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementProperty, ɵɵelementStart, ɵɵelementStyleProp, ɵɵelementStyling, ɵɵelementStylingApply, ɵɵlistener, ɵɵload, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {ΔpureFunction1, ΔpureFunction2} from '../../src/render3/pure_function';
import {ΔcontentQuery, ΔloadContentQuery, ΔqueryRefresh} from '../../src/render3/query';
import {ɵɵpureFunction1, ɵɵpureFunction2} from '../../src/render3/pure_function';
import {ɵɵcontentQuery, ɵɵloadContentQuery, ɵɵqueryRefresh} from '../../src/render3/query';
import {bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustUrl} from '../../src/sanitization/bypass';
import {ΔsanitizeHtml, ΔsanitizeUrl, ΔsanitizeUrlOrResourceUrl} from '../../src/sanitization/sanitization';
import {ɵɵsanitizeHtml, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl} from '../../src/sanitization/sanitization';
import {NgForOf} from './common_with_def';
import {ComponentFixture, TemplateFixture, createComponent, createDirective} from './render_util';
@ -32,7 +32,7 @@ describe('host bindings', () => {
class NameComp {
names !: string[];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: NameComp,
selectors: [['name-comp']],
factory: function NameComp_Factory() { return nameComp = new NameComp(); },
@ -47,16 +47,16 @@ describe('host bindings', () => {
// @HostBinding()
id = 'foo';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: HostBindingDir,
selectors: [['', 'hostBindingDir', '']],
factory: () => hostBindingDir = new HostBindingDir(),
hostBindings: (rf: RenderFlags, ctx: any, elementIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elementIndex, 'id', Δbind(ctx.id), null, true);
ɵɵelementProperty(elementIndex, 'id', ɵɵbind(ctx.id), null, true);
}
}
});
@ -66,7 +66,7 @@ describe('host bindings', () => {
// @HostBinding()
id = 'my-id';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingComp,
selectors: [['host-binding-comp']],
factory: () => new HostBindingComp(),
@ -74,10 +74,10 @@ describe('host bindings', () => {
vars: 0,
hostBindings: (rf: RenderFlags, ctx: HostBindingComp, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ctx.id), null, true);
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ctx.id), null, true);
}
},
template: (rf: RenderFlags, ctx: HostBindingComp) => {}
@ -91,23 +91,23 @@ describe('host bindings', () => {
// @HostBinding('className')
klass = 'foo';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Directive,
selectors: [['', 'dir', '']],
factory: () => directiveInstance = new Directive,
hostBindings: (rf: RenderFlags, ctx: any, elementIndex: number) => {
elementIndices.push(elementIndex);
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elementIndex, 'className', Δbind(ctx.klass), null, true);
ɵɵelementProperty(elementIndex, 'className', ɵɵbind(ctx.klass), null, true);
}
}
});
}
function Template() { Δelement(0, 'span', [AttributeMarker.Bindings, 'dir']); }
function Template() { ɵɵelement(0, 'span', [AttributeMarker.Bindings, 'dir']); }
const fixture = new TemplateFixture(Template, () => {}, 1, 0, [Directive]);
expect(fixture.html).toEqual('<span class="foo"></span>');
@ -127,7 +127,7 @@ describe('host bindings', () => {
// @HostBinding()
id = 'my-id';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingComp,
selectors: [['host-binding-comp']],
factory: () => new HostBindingComp(),
@ -136,10 +136,10 @@ describe('host bindings', () => {
hostBindings: (rf: RenderFlags, ctx: HostBindingComp, elIndex: number) => {
elementIndices.push(elIndex);
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ctx.id), null, true);
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ctx.id), null, true);
}
},
template: (rf: RenderFlags, ctx: HostBindingComp) => {}
@ -172,23 +172,23 @@ describe('host bindings', () => {
constructor(public serviceOne: ServiceOne, public serviceTwo: ServiceTwo) {}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: CompWithProviders,
selectors: [['comp-with-providers']],
factory:
() => new CompWithProviders(ΔdirectiveInject(ServiceOne), ΔdirectiveInject(ServiceTwo)),
factory: () => new CompWithProviders(
ɵɵdirectiveInject(ServiceOne), ɵɵdirectiveInject(ServiceTwo)),
consts: 0,
vars: 0,
hostBindings: (rf: RenderFlags, ctx: CompWithProviders, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ctx.id), null, true);
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ctx.id), null, true);
}
},
template: (rf: RenderFlags, ctx: CompWithProviders) => {},
features: [ΔProvidersFeature([[ServiceOne], [ServiceTwo]])]
features: [ɵɵProvidersFeature([[ServiceOne], [ServiceTwo]])]
});
}
@ -209,7 +209,7 @@ describe('host bindings', () => {
// @HostBinding()
title = 'my-title';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostTitleComp,
selectors: [['host-title-comp']],
factory: () => new HostTitleComp(),
@ -217,10 +217,10 @@ describe('host bindings', () => {
vars: 0,
hostBindings: (rf: RenderFlags, ctx: HostTitleComp, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'title', Δbind(ctx.title), null, true);
ɵɵelementProperty(elIndex, 'title', ɵɵbind(ctx.title), null, true);
}
},
template: (rf: RenderFlags, ctx: HostTitleComp) => {}
@ -234,9 +234,9 @@ describe('host bindings', () => {
*/
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['hostBindingDir', '']);
Δelement(1, 'div', ['someDir', '']);
Δelement(2, 'host-title-comp');
ɵɵelement(0, 'div', ['hostBindingDir', '']);
ɵɵelement(1, 'div', ['someDir', '']);
ɵɵelement(2, 'host-title-comp');
}
}, 3, 0, [HostBindingDir, SomeDir, HostTitleComp]);
@ -258,7 +258,7 @@ describe('host bindings', () => {
// @HostBinding()
id = 'blue';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingComp,
selectors: [['host-binding-comp']],
factory: () => {
@ -270,10 +270,10 @@ describe('host bindings', () => {
vars: 0,
hostBindings: (rf: RenderFlags, ctx: HostBindingComp, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ctx.id), null, true);
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ctx.id), null, true);
}
},
template: (rf: RenderFlags, ctx: HostBindingComp) => {}
@ -286,8 +286,8 @@ describe('host bindings', () => {
* */
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'host-binding-comp');
Δelement(1, 'host-binding-comp');
ɵɵelement(0, 'host-binding-comp');
ɵɵelement(1, 'host-binding-comp');
}
}, 2, 0, [HostBindingComp]);
@ -318,7 +318,7 @@ describe('host bindings', () => {
/** <div someDir hostBindingDir></div> */
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['someDir', '', 'hostBindingDir', '']);
ɵɵelement(0, 'div', ['someDir', '', 'hostBindingDir', '']);
}
}, 1, 0, [SomeDir, HostBindingDir]);
@ -350,20 +350,20 @@ describe('host bindings', () => {
return `${this.inputValue}-${this.changesValue}-${this.initValue}-${this.checkValue}`;
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: InitHookComp,
selectors: [['init-hook-comp']],
factory: () => new InitHookComp(),
template: (rf: RenderFlags, ctx: InitHookComp) => {},
consts: 0,
vars: 0,
features: [ΔNgOnChangesFeature()],
features: [ɵɵNgOnChangesFeature()],
hostBindings: (rf: RenderFlags, ctx: InitHookComp, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'title', Δbind(ctx.value), null, true);
ɵɵelementProperty(elIndex, 'title', ɵɵbind(ctx.value), null, true);
}
},
inputs: {inputValue: 'inputValue'}
@ -374,16 +374,16 @@ describe('host bindings', () => {
class App {
value = 'input';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: App,
selectors: [['app']],
factory: () => new App(),
template: (rf: RenderFlags, ctx: App) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'init-hook-comp');
ɵɵelement(0, 'init-hook-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'inputValue', Δbind(ctx.value));
ɵɵelementProperty(0, 'inputValue', ɵɵbind(ctx.value));
}
},
consts: 1,
@ -411,16 +411,16 @@ describe('host bindings', () => {
// @HostBinding('disabled')
hostDisabled = false;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: HostBindingInputDir,
selectors: [['', 'hostBindingDir', '']],
factory: () => hostBindingInputDir = new HostBindingInputDir(),
hostBindings: (rf: RenderFlags, ctx: HostBindingInputDir, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'disabled', Δbind(ctx.hostDisabled), null, true);
ɵɵelementProperty(elIndex, 'disabled', ɵɵbind(ctx.hostDisabled), null, true);
}
},
inputs: {disabled: 'disabled'}
@ -431,16 +431,16 @@ describe('host bindings', () => {
class App {
isDisabled = true;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: App,
selectors: [['app']],
factory: () => new App(),
template: (rf: RenderFlags, ctx: App) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'input', ['hostBindingDir', '']);
ɵɵelement(0, 'input', ['hostBindingDir', '']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'disabled', Δbind(ctx.isDisabled));
ɵɵelementProperty(0, 'disabled', ɵɵbind(ctx.isDisabled));
}
},
consts: 1,
@ -469,7 +469,7 @@ describe('host bindings', () => {
/** <div hostBindingDir></div> */
const Parent = createComponent('parent', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['hostBindingDir', '']);
ɵɵelement(0, 'div', ['hostBindingDir', '']);
}
}, 1, 0, [HostBindingDir]);
@ -479,8 +479,8 @@ describe('host bindings', () => {
*/
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'parent');
Δelement(1, 'parent');
ɵɵelement(0, 'parent');
ɵɵelement(1, 'parent');
}
}, 2, 0, [Parent]);
@ -493,9 +493,9 @@ describe('host bindings', () => {
it('should support host bindings in for loop', () => {
function NgForTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
{ Δelement(1, 'p', ['hostBindingDir', '']); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵelement(1, 'p', ['hostBindingDir', '']); }
ɵɵelementEnd();
}
}
@ -506,10 +506,10 @@ describe('host bindings', () => {
*/
const App = createComponent('parent', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δtemplate(0, NgForTemplate, 2, 0, 'div', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
ɵɵtemplate(0, NgForTemplate, 2, 0, 'div', [AttributeMarker.Template, 'ngFor', 'ngForOf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngForOf', Δbind(ctx.rows));
ɵɵelementProperty(0, 'ngForOf', ɵɵbind(ctx.rows));
}
}, 1, 1, [HostBindingDir, NgForOf]);
@ -532,11 +532,11 @@ describe('host bindings', () => {
*/
const AppComponent = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'name-comp');
Δelement(1, 'host-binding-comp');
ɵɵelement(0, 'name-comp');
ɵɵelement(1, 'host-binding-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'names', Δbind(ΔpureFunction1(1, ff, ctx.name)));
ɵɵelementProperty(0, 'names', ɵɵbind(ɵɵpureFunction1(1, ff, ctx.name)));
}
}, 2, 3, [HostBindingComp, NameComp]);
@ -584,7 +584,7 @@ describe('host bindings', () => {
title = 'my title';
otherTitle = 'other title';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingComp,
selectors: [['host-binding-comp']],
factory: () => hostBindingComp = new HostBindingComp(),
@ -593,13 +593,13 @@ describe('host bindings', () => {
hostBindings: (rf: RenderFlags, ctx: HostBindingComp, elIndex: number) => {
// LView: [..., id, dir, title, ctx.id, pf1, ctx.title, ctx.otherTitle, pf2]
if (rf & RenderFlags.Create) {
ΔallocHostVars(8);
ɵɵallocHostVars(8);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ΔpureFunction1(3, ff, ctx.id)), null, true);
ΔelementProperty(elIndex, 'dir', Δbind(ctx.dir), null, true);
ΔelementProperty(
elIndex, 'title', Δbind(ΔpureFunction2(5, ff2, ctx.title, ctx.otherTitle)), null,
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ɵɵpureFunction1(3, ff, ctx.id)), null, true);
ɵɵelementProperty(elIndex, 'dir', ɵɵbind(ctx.dir), null, true);
ɵɵelementProperty(
elIndex, 'title', ɵɵbind(ɵɵpureFunction2(5, ff2, ctx.title, ctx.otherTitle)), null,
true);
}
},
@ -613,11 +613,11 @@ describe('host bindings', () => {
*/
const AppComponent = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'name-comp');
Δelement(1, 'host-binding-comp');
ɵɵelement(0, 'name-comp');
ɵɵelement(1, 'host-binding-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'names', Δbind(ΔpureFunction2(1, ff3, ctx.name, ctx.otherName)));
ɵɵelementProperty(0, 'names', ɵɵbind(ɵɵpureFunction2(1, ff3, ctx.name, ctx.otherName)));
}
}, 2, 4, [HostBindingComp, NameComp]);
@ -663,7 +663,7 @@ describe('host bindings', () => {
class HostBindingComp {
id = 'blue';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingComp,
selectors: [['host-binding-comp']],
factory: () => hostBindingComp = new HostBindingComp(),
@ -672,10 +672,10 @@ describe('host bindings', () => {
hostBindings: (rf: RenderFlags, ctx: HostBindingComp, elIndex: number) => {
// LView: [..., id, ctx.id, pf1]
if (rf & RenderFlags.Create) {
ΔallocHostVars(3);
ɵɵallocHostVars(3);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ΔpureFunction1(1, ff, ctx.id)), null, true);
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ɵɵpureFunction1(1, ff, ctx.id)), null, true);
}
},
template: (rf: RenderFlags, ctx: HostBindingComp) => {}
@ -696,18 +696,18 @@ describe('host bindings', () => {
class HostBindingDir {
title = 'my title';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: HostBindingDir,
selectors: [['', 'hostDir', '']],
factory: () => hostBindingDir = new HostBindingDir(),
hostBindings: (rf: RenderFlags, ctx: HostBindingDir, elIndex: number) => {
// LView: [..., title, ctx.title, pf1]
if (rf & RenderFlags.Create) {
ΔallocHostVars(3);
ɵɵallocHostVars(3);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(
elIndex, 'title', Δbind(ΔpureFunction1(1, ff1, ctx.title)), null, true);
ɵɵelementProperty(
elIndex, 'title', ɵɵbind(ɵɵpureFunction1(1, ff1, ctx.title)), null, true);
}
}
});
@ -719,7 +719,7 @@ describe('host bindings', () => {
*/
const AppComponent = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'host-binding-comp', ['hostDir', '']);
ɵɵelement(0, 'host-binding-comp', ['hostDir', '']);
}
}, 1, 0, [HostBindingComp, HostBindingDir]);
@ -754,18 +754,18 @@ describe('host bindings', () => {
class HostBindingDir {
title = 'my title';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: HostBindingDir,
selectors: [['', 'hostDir', '']],
factory: () => new HostBindingDir(),
hostBindings: (rf: RenderFlags, ctx: HostBindingDir, elIndex: number) => {
// LView [..., title, ctx.title, pf1]
if (rf & RenderFlags.Create) {
ΔallocHostVars(3);
ɵɵallocHostVars(3);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(
elIndex, 'title', Δbind(ΔpureFunction1(1, ff1, ctx.title)), null, true);
ɵɵelementProperty(
elIndex, 'title', ɵɵbind(ɵɵpureFunction1(1, ff1, ctx.title)), null, true);
}
}
});
@ -775,14 +775,14 @@ describe('host bindings', () => {
/* @HostListener('click') */
onClick() { events.push('click!'); }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: HostListenerDir,
selectors: [['', 'hostListenerDir', '']],
factory: function HostListenerDir_Factory() { return new HostListenerDir(); },
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
if (rf & RenderFlags.Create) {
Δlistener('click', function() { return ctx.onClick(); });
ɵɵlistener('click', function() { return ctx.onClick(); });
}
}
});
@ -790,9 +790,9 @@ describe('host bindings', () => {
// <button hostListenerDir hostDir>Click</button>
const fixture = new TemplateFixture(() => {
ΔelementStart(0, 'button', ['hostListenerDir', '', 'hostDir', '']);
Δtext(1, 'Click');
ΔelementEnd();
ɵɵelementStart(0, 'button', ['hostListenerDir', '', 'hostDir', '']);
ɵɵtext(1, 'Click');
ɵɵelementEnd();
}, () => {}, 2, 0, [HostListenerDir, HostBindingDir]);
const button = fixture.hostElement.querySelector('button') !;
@ -823,7 +823,7 @@ describe('host bindings', () => {
id = 'blue';
title = 'blue';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingComp,
selectors: [['host-binding-comp']],
factory: () => hostBindingComp = new HostBindingComp(),
@ -832,16 +832,16 @@ describe('host bindings', () => {
hostBindings: (rf: RenderFlags, ctx: HostBindingComp, elIndex: number) => {
// LView: [..., id, title, ctx.id, pf1, ctx.title, pf1]
if (rf & RenderFlags.Create) {
ΔallocHostVars(6);
ɵɵallocHostVars(6);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(
elIndex, 'id', Δbind(ctx.condition ? ΔpureFunction1(2, ff, ctx.id) : 'green'), null,
true);
ΔelementProperty(
ɵɵelementProperty(
elIndex, 'id', ɵɵbind(ctx.condition ? ɵɵpureFunction1(2, ff, ctx.id) : 'green'),
null, true);
ɵɵelementProperty(
elIndex, 'title',
Δbind(ctx.otherCondition ? ΔpureFunction1(4, ff1, ctx.title) : 'other title'), null,
true);
ɵɵbind(ctx.otherCondition ? ɵɵpureFunction1(4, ff1, ctx.title) : 'other title'),
null, true);
}
},
template: (rf: RenderFlags, ctx: HostBindingComp) => {}
@ -854,11 +854,11 @@ describe('host bindings', () => {
*/
const AppComponent = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'host-binding-comp');
Δtext(1);
ɵɵelement(0, 'host-binding-comp');
ɵɵtext(1);
}
if (rf & RenderFlags.Update) {
ΔtextBinding(1, Δbind(ctx.name));
ɵɵtextBinding(1, ɵɵbind(ctx.name));
}
}, 2, 1, [HostBindingComp]);
@ -890,15 +890,15 @@ describe('host bindings', () => {
class SuperDirective {
id = 'my-id';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SuperDirective,
selectors: [['', 'superDir', '']],
hostBindings: (rf: RenderFlags, ctx: SuperDirective, elementIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elementIndex, 'id', Δbind(ctx.id), null, true);
ɵɵelementProperty(elementIndex, 'id', ɵɵbind(ctx.id), null, true);
}
},
factory: () => superDir = new SuperDirective(),
@ -908,26 +908,26 @@ describe('host bindings', () => {
class SubDirective extends SuperDirective {
title = 'my-title';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'subDir', '']],
hostBindings: (rf: RenderFlags, ctx: SubDirective, elementIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elementIndex, 'title', Δbind(ctx.title), null, true);
ɵɵelementProperty(elementIndex, 'title', ɵɵbind(ctx.title), null, true);
}
},
factory: () => subDir = new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['subDir', '']);
Δelement(1, 'div', ['superDir', '']);
ɵɵelement(0, 'div', ['subDir', '']);
ɵɵelement(1, 'div', ['superDir', '']);
}
}, 2, 0, [SubDirective, SuperDirective]);
@ -964,13 +964,13 @@ describe('host bindings', () => {
// 'role': 'listbox'
// }
class HostAttributeDir {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
selectors: [['', 'hostAttributeDir', '']],
type: HostAttributeDir,
factory: () => new HostAttributeDir(),
hostBindings: function(rf, ctx, elIndex) {
if (rf & RenderFlags.Create) {
ΔelementHostAttrs(['role', 'listbox']);
ɵɵelementHostAttrs(['role', 'listbox']);
}
}
});
@ -979,7 +979,7 @@ describe('host bindings', () => {
// <div hostAttributeDir></div>
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['hostAttributeDir', '']);
ɵɵelement(0, 'div', ['hostAttributeDir', '']);
}
}, 1, 0, [HostAttributeDir]);
@ -997,7 +997,7 @@ describe('host bindings', () => {
// @ContentChildren('foo')
foos !: QueryList<any>;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingWithContentChildren,
selectors: [['host-binding-comp']],
factory: () => new HostBindingWithContentChildren(),
@ -1005,19 +1005,19 @@ describe('host bindings', () => {
vars: 0,
hostBindings: (rf: RenderFlags, ctx: HostBindingWithContentChildren, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ctx.foos.length), null, true);
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ctx.foos.length), null, true);
}
},
contentQueries: (rf: RenderFlags, ctx: any, dirIndex: number) => {
if (rf & RenderFlags.Create) {
ΔcontentQuery(dirIndex, ['foo'], false, null);
ɵɵcontentQuery(dirIndex, ['foo'], false, null);
}
if (rf & RenderFlags.Update) {
let tmp: any;
ΔqueryRefresh(tmp = ΔloadContentQuery<ElementRef>()) && (ctx.foos = tmp);
ɵɵqueryRefresh(tmp = ɵɵloadContentQuery<ElementRef>()) && (ctx.foos = tmp);
}
},
template: (rf: RenderFlags, cmp: HostBindingWithContentChildren) => {}
@ -1032,12 +1032,12 @@ describe('host bindings', () => {
*/
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'host-binding-comp');
ɵɵelementStart(0, 'host-binding-comp');
{
Δelement(1, 'div', null, ['foo', '']);
Δelement(3, 'div', null, ['foo', '']);
ɵɵelement(1, 'div', null, ['foo', '']);
ɵɵelement(3, 'div', null, ['foo', '']);
}
ΔelementEnd();
ɵɵelementEnd();
}
}, 5, 0, [HostBindingWithContentChildren]);
@ -1059,7 +1059,7 @@ describe('host bindings', () => {
ngAfterViewInit() { this.myValue = 'after-view'; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingWithContentHooks,
selectors: [['host-binding-comp']],
factory: () => new HostBindingWithContentHooks(),
@ -1067,10 +1067,10 @@ describe('host bindings', () => {
vars: 0,
hostBindings: (rf: RenderFlags, ctx: HostBindingWithContentHooks, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elIndex, 'id', Δbind(ctx.myValue), null, true);
ɵɵelementProperty(elIndex, 'id', ɵɵbind(ctx.myValue), null, true);
}
},
template: (rf: RenderFlags, cmp: HostBindingWithContentHooks) => {}
@ -1080,7 +1080,7 @@ describe('host bindings', () => {
/** <host-binding-comp></host-binding-comp> */
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'host-binding-comp');
ɵɵelement(0, 'host-binding-comp');
}
}, 1, 0, [HostBindingWithContentHooks]);
@ -1101,7 +1101,7 @@ describe('host bindings', () => {
class HostBindingToStyles {
width = 2;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: HostBindingToStyles,
selectors: [['host-binding-to-styles']],
factory: () => hostBindingDir = new HostBindingToStyles(),
@ -1109,11 +1109,11 @@ describe('host bindings', () => {
vars: 0,
hostBindings: (rf: RenderFlags, ctx: HostBindingToStyles, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔelementHostStyling(null, ['width']);
ɵɵelementHostStyling(null, ['width']);
}
if (rf & RenderFlags.Update) {
ΔelementHostStyleProp(0, ctx.width, 'px');
ΔelementHostStylingApply();
ɵɵelementHostStyleProp(0, ctx.width, 'px');
ɵɵelementHostStylingApply();
}
},
template: (rf: RenderFlags, cmp: HostBindingToStyles) => {}
@ -1123,7 +1123,7 @@ describe('host bindings', () => {
/** <host-binding-to-styles></host-binding-to-styles> */
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'host-binding-to-styles');
ɵɵelement(0, 'host-binding-to-styles');
}
}, 1, 0, [HostBindingToStyles]);
@ -1147,17 +1147,17 @@ describe('host bindings', () => {
class HostBindingToStyles {
width = 2;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: HostBindingToStyles,
selectors: [['', 'hostStyles', '']],
factory: () => hostBindingDir = new HostBindingToStyles(),
hostBindings: (rf: RenderFlags, ctx: HostBindingToStyles, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔelementHostStyling(null, ['width']);
ɵɵelementHostStyling(null, ['width']);
}
if (rf & RenderFlags.Update) {
ΔelementHostStyleProp(0, ctx.width, 'px');
ΔelementHostStylingApply();
ɵɵelementHostStyleProp(0, ctx.width, 'px');
ɵɵelementHostStylingApply();
}
}
});
@ -1166,17 +1166,17 @@ describe('host bindings', () => {
class ContainerDir {
constructor(public vcr: ViewContainerRef) {}
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: ContainerDir,
selectors: [['', 'containerDir', '']],
factory: () => new ContainerDir(ΔdirectiveInject(ViewContainerRef as any)),
factory: () => new ContainerDir(ɵɵdirectiveInject(ViewContainerRef as any)),
});
}
/** <div hostStyles containerDir></div> */
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['containerDir', '', 'hostStyles', '']);
ɵɵelement(0, 'div', ['containerDir', '', 'hostStyles', '']);
}
}, 1, 0, [ContainerDir, HostBindingToStyles]);
@ -1196,7 +1196,7 @@ describe('host bindings', () => {
* }
*/
class StaticHostClass {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: StaticHostClass,
selectors: [['static-host-class']],
factory: () => new StaticHostClass(),
@ -1204,11 +1204,11 @@ describe('host bindings', () => {
vars: 0,
hostBindings: (rf: RenderFlags, ctx: StaticHostClass, elIndex: number) => {
if (rf & RenderFlags.Create) {
ΔelementHostAttrs([AttributeMarker.Classes, 'mat-toolbar']);
ΔelementHostStyling(['mat-toolbar']);
ɵɵelementHostAttrs([AttributeMarker.Classes, 'mat-toolbar']);
ɵɵelementHostStyling(['mat-toolbar']);
}
if (rf & RenderFlags.Update) {
ΔelementHostStylingApply();
ɵɵelementHostStylingApply();
}
},
template: (rf: RenderFlags, cmp: StaticHostClass) => {}
@ -1218,7 +1218,7 @@ describe('host bindings', () => {
/** <static-host-class></static-host-class> */
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'static-host-class');
ɵɵelement(0, 'static-host-class');
}
}, 1, 0, [StaticHostClass]);
@ -1236,24 +1236,24 @@ describe('host bindings', () => {
let hostBindingDir: UnsafeUrlHostBindingDir;
class UnsafeUrlHostBindingDir {
// val: any = value;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: UnsafeUrlHostBindingDir,
selectors: [['', 'unsafeUrlHostBindingDir', '']],
factory: () => hostBindingDir = new UnsafeUrlHostBindingDir(),
hostBindings: (rf: RenderFlags, ctx: any, elementIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
const fn = isAttribute ? ΔelementAttribute : ΔelementProperty;
(fn as any)(elementIndex, prop, Δbind(ctx[prop]), sanitizeFn, true);
const fn = isAttribute ? ɵɵelementAttribute : ɵɵelementProperty;
(fn as any)(elementIndex, prop, ɵɵbind(ctx[prop]), sanitizeFn, true);
}
}
});
}
const fixture = new TemplateFixture(() => {
Δelement(0, tag, ['unsafeUrlHostBindingDir', '']);
ɵɵelement(0, tag, ['unsafeUrlHostBindingDir', '']);
}, () => {}, 1, 0, [UnsafeUrlHostBindingDir]);
const el = fixture.hostElement.querySelector(tag) !;
@ -1270,17 +1270,17 @@ describe('host bindings', () => {
}
verify(
'a', 'href', 'javascript:alert(1)', 'unsafe:javascript:alert(1)', ΔsanitizeUrlOrResourceUrl,
bypassSanitizationTrustUrl);
'a', 'href', 'javascript:alert(1)', 'unsafe:javascript:alert(1)',
ɵɵsanitizeUrlOrResourceUrl, bypassSanitizationTrustUrl);
verify(
'script', 'src', bypassSanitizationTrustResourceUrl('javascript:alert(2)'),
'javascript:alert(2)', ΔsanitizeUrlOrResourceUrl, bypassSanitizationTrustResourceUrl);
'javascript:alert(2)', ɵɵsanitizeUrlOrResourceUrl, bypassSanitizationTrustResourceUrl);
verify(
'blockquote', 'cite', 'javascript:alert(3)', 'unsafe:javascript:alert(3)', ΔsanitizeUrl,
'blockquote', 'cite', 'javascript:alert(3)', 'unsafe:javascript:alert(3)', ɵɵsanitizeUrl,
bypassSanitizationTrustUrl);
verify(
'b', 'innerHTML', '<img src="javascript:alert(4)">',
'<img src="unsafe:javascript:alert(4)">', ΔsanitizeHtml, bypassSanitizationTrustHtml,
'<img src="unsafe:javascript:alert(4)">', ɵɵsanitizeHtml, bypassSanitizationTrustHtml,
/* isAttribute */ false);
});
});

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
*/
import {ElementRef, Inject, InjectionToken, QueryList, ɵAttributeMarker as AttributeMarker} from '../../src/core';
import {ΔallocHostVars, Δbind, ComponentDef, ΔcontentQuery, ΔdefineBase, ΔdefineComponent, ΔdefineDirective, DirectiveDef, ΔdirectiveInject, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔInheritDefinitionFeature, Δload, ΔloadContentQuery, ΔloadViewQuery, ΔNgOnChangesFeature, ΔProvidersFeature, ΔqueryRefresh, RenderFlags, ΔviewQuery,} from '../../src/render3/index';
import {ɵɵallocHostVars, ɵɵbind, ComponentDef, ɵɵcontentQuery, ɵɵdefineBase, ɵɵdefineComponent, ɵɵdefineDirective, DirectiveDef, ɵɵdirectiveInject, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵInheritDefinitionFeature, ɵɵload, ɵɵloadContentQuery, ɵɵloadViewQuery, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵqueryRefresh, RenderFlags, ɵɵviewQuery,} from '../../src/render3/index';
import {ComponentFixture, createComponent, getDirectiveOnNode} from './render_util';
@ -28,11 +28,11 @@ describe('InheritDefinitionFeature', () => {
ngAfterViewChecked() {}
ngDoCheck() {}
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'subDir', '']],
factory: () => new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
@ -50,7 +50,7 @@ describe('InheritDefinitionFeature', () => {
it('should inherit inputs', () => {
class SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
inputs: {
superFoo: ['foo', 'declaredFoo'],
superBar: 'bar',
@ -63,7 +63,7 @@ describe('InheritDefinitionFeature', () => {
}
class SubDirective extends SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
inputs: {
subBaz: 'baz',
@ -71,7 +71,7 @@ describe('InheritDefinitionFeature', () => {
},
selectors: [['', 'subDir', '']],
factory: () => new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
@ -93,7 +93,7 @@ describe('InheritDefinitionFeature', () => {
it('should inherit outputs', () => {
class SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
outputs: {
superFoo: 'foo',
superBar: 'bar',
@ -106,7 +106,7 @@ describe('InheritDefinitionFeature', () => {
}
class SubDirective extends SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
outputs: {
subBaz: 'baz',
@ -114,7 +114,7 @@ describe('InheritDefinitionFeature', () => {
},
selectors: [['', 'subDir', '']],
factory: () => new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
@ -130,7 +130,7 @@ describe('InheritDefinitionFeature', () => {
it('should detect EMPTY inputs and outputs', () => {
class SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
inputs: {
testIn: 'testIn',
},
@ -144,11 +144,11 @@ describe('InheritDefinitionFeature', () => {
}
class SubDirective extends SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'subDir', '']],
factory: () => new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
@ -167,7 +167,7 @@ describe('InheritDefinitionFeature', () => {
class Class5 {
input5 = 'data, so data';
static ngBaseDef = ΔdefineBase({
static ngBaseDef = ɵɵdefineBase({
inputs: {
input5: 'input5',
},
@ -177,14 +177,14 @@ describe('InheritDefinitionFeature', () => {
class Class4 extends Class5 {
input4 = 'hehe';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
inputs: {
input4: 'input4',
},
type: Class4,
selectors: [['', 'superDir', '']],
factory: () => new Class4(),
features: [ΔInheritDefinitionFeature],
features: [ɵɵInheritDefinitionFeature],
});
}
@ -193,7 +193,7 @@ describe('InheritDefinitionFeature', () => {
class Class2 extends Class3 {
input3 = 'wee';
static ngBaseDef = ΔdefineBase({
static ngBaseDef = ɵɵdefineBase({
inputs: {
input3: ['alias3', 'input3'],
}
@ -204,7 +204,7 @@ describe('InheritDefinitionFeature', () => {
input1 = 'test';
input2 = 'whatever';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Class1,
inputs: {
input1: 'input1',
@ -212,7 +212,7 @@ describe('InheritDefinitionFeature', () => {
},
selectors: [['', 'subDir', '']],
factory: () => new Class1(),
features: [ΔInheritDefinitionFeature],
features: [ɵɵInheritDefinitionFeature],
});
}
@ -239,7 +239,7 @@ describe('InheritDefinitionFeature', () => {
class Class5 {
output5 = 'data, so data';
static ngBaseDef = ΔdefineBase({
static ngBaseDef = ɵɵdefineBase({
outputs: {
output5: 'alias5',
},
@ -249,14 +249,14 @@ describe('InheritDefinitionFeature', () => {
class Class4 extends Class5 {
output4 = 'hehe';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
outputs: {
output4: 'alias4',
},
type: Class4,
selectors: [['', 'superDir', '']],
factory: () => new Class4(),
features: [ΔInheritDefinitionFeature],
features: [ɵɵInheritDefinitionFeature],
});
}
@ -265,7 +265,7 @@ describe('InheritDefinitionFeature', () => {
class Class2 extends Class3 {
output3 = 'wee';
static ngBaseDef = ΔdefineBase({
static ngBaseDef = ɵɵdefineBase({
outputs: {
output3: 'alias3',
}
@ -276,7 +276,7 @@ describe('InheritDefinitionFeature', () => {
output1 = 'test';
output2 = 'whatever';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Class1,
outputs: {
output1: 'alias1',
@ -284,7 +284,7 @@ describe('InheritDefinitionFeature', () => {
},
selectors: [['', 'subDir', '']],
factory: () => new Class1(),
features: [ΔInheritDefinitionFeature],
features: [ɵɵInheritDefinitionFeature],
});
}
@ -305,15 +305,15 @@ describe('InheritDefinitionFeature', () => {
class SuperDirective {
id = 'my-id';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SuperDirective,
selectors: [['', 'superDir', '']],
hostBindings: (rf: RenderFlags, ctx: SuperDirective, elementIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elementIndex, 'id', Δbind(ctx.id));
ɵɵelementProperty(elementIndex, 'id', ɵɵbind(ctx.id));
}
},
factory: () => new SuperDirective(),
@ -323,26 +323,26 @@ describe('InheritDefinitionFeature', () => {
class SubDirective extends SuperDirective {
title = 'my-title';
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'subDir', '']],
hostBindings: (rf: RenderFlags, ctx: SubDirective, elementIndex: number) => {
if (rf & RenderFlags.Create) {
ΔallocHostVars(1);
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(elementIndex, 'title', Δbind(ctx.title));
ɵɵelementProperty(elementIndex, 'title', ɵɵbind(ctx.title));
}
},
factory: () => subDir = new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['subDir', '']);
ɵɵelement(0, 'div', ['subDir', '']);
}
}, 1, 0, [SubDirective]);
@ -374,7 +374,7 @@ describe('InheritDefinitionFeature', () => {
*/
class SuperComponent {
superQuery?: QueryList<any>;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SuperComponent,
template: () => {},
consts: 0,
@ -382,11 +382,11 @@ describe('InheritDefinitionFeature', () => {
selectors: [['super-comp']],
viewQuery: <T>(rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
ΔviewQuery(['super'], false, null);
ɵɵviewQuery(['super'], false, null);
}
if (rf & RenderFlags.Update) {
let tmp: any;
ΔqueryRefresh(tmp = ΔloadViewQuery<QueryList<any>>()) &&
ɵɵqueryRefresh(tmp = ɵɵloadViewQuery<QueryList<any>>()) &&
(ctx.superQuery = tmp as QueryList<any>);
}
},
@ -404,13 +404,13 @@ describe('InheritDefinitionFeature', () => {
*/
class SubComponent extends SuperComponent {
subQuery?: QueryList<any>;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SubComponent,
template: (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['id', 'sub'], ['sub', '']);
Δelement(2, 'div', ['id', 'super'], ['super', '']);
Δelement(4, 'some-comp');
ɵɵelement(0, 'div', ['id', 'sub'], ['sub', '']);
ɵɵelement(2, 'div', ['id', 'super'], ['super', '']);
ɵɵelement(4, 'some-comp');
}
},
consts: 5,
@ -418,16 +418,16 @@ describe('InheritDefinitionFeature', () => {
selectors: [['sub-comp']],
viewQuery: (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
ΔviewQuery(['sub'], false, null);
ɵɵviewQuery(['sub'], false, null);
}
if (rf & RenderFlags.Update) {
let tmp: any;
ΔqueryRefresh(tmp = ΔloadViewQuery<QueryList<any>>()) &&
ɵɵqueryRefresh(tmp = ɵɵloadViewQuery<QueryList<any>>()) &&
(ctx.subQuery = tmp as QueryList<any>);
}
},
factory: () => new SubComponent(),
features: [ΔInheritDefinitionFeature],
features: [ɵɵInheritDefinitionFeature],
directives: [SomeComp]
});
}
@ -437,7 +437,7 @@ describe('InheritDefinitionFeature', () => {
const log: Array<[string, RenderFlags, any]> = [];
class SuperComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SuperComponent,
template: () => {},
consts: 0,
@ -451,7 +451,7 @@ describe('InheritDefinitionFeature', () => {
}
class SubComponent extends SuperComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SubComponent,
template: () => {},
consts: 0,
@ -461,7 +461,7 @@ describe('InheritDefinitionFeature', () => {
log.push(['sub', rf, ctx]);
},
factory: () => new SubComponent(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
@ -497,8 +497,8 @@ describe('InheritDefinitionFeature', () => {
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'sub-comp');
Δelement(1, 'sub-comp');
ɵɵelement(0, 'sub-comp');
ɵɵelement(1, 'sub-comp');
}
subCompOne = getDirectiveOnNode(0);
subCompTwo = getDirectiveOnNode(1);
@ -524,7 +524,7 @@ describe('InheritDefinitionFeature', () => {
const log: string[] = [];
class SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SuperDirective,
selectors: [['', 'superDir', '']],
contentQueries: () => { log.push('super'); },
@ -533,12 +533,12 @@ describe('InheritDefinitionFeature', () => {
}
class SubDirective extends SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'subDir', '']],
contentQueries: () => { log.push('sub'); },
factory: () => new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
@ -555,17 +555,17 @@ describe('InheritDefinitionFeature', () => {
// @ContentChildren('foo')
foos !: QueryList<ElementRef>;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SuperDirective,
selectors: [['', 'super-dir', '']],
factory: () => new SuperDirective(),
contentQueries: (rf: RenderFlags, ctx: any, dirIndex: number) => {
if (rf & RenderFlags.Create) {
ΔcontentQuery(dirIndex, ['foo'], true, null);
ɵɵcontentQuery(dirIndex, ['foo'], true, null);
}
if (rf & RenderFlags.Update) {
let tmp: any;
ΔqueryRefresh(tmp = ΔloadContentQuery<ElementRef>()) && (ctx.foos = tmp);
ɵɵqueryRefresh(tmp = ɵɵloadContentQuery<ElementRef>()) && (ctx.foos = tmp);
}
}
});
@ -575,20 +575,20 @@ describe('InheritDefinitionFeature', () => {
// @ContentChildren('bar')
bars !: QueryList<ElementRef>;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'sub-dir', '']],
factory: () => dirInstance = new SubDirective(),
contentQueries: (rf: RenderFlags, ctx: any, dirIndex: number) => {
if (rf & RenderFlags.Create) {
ΔcontentQuery(dirIndex, ['bar'], true, null);
ɵɵcontentQuery(dirIndex, ['bar'], true, null);
}
if (rf & RenderFlags.Update) {
let tmp: any;
ΔqueryRefresh(tmp = ΔloadContentQuery<ElementRef>()) && (ctx.bars = tmp);
ɵɵqueryRefresh(tmp = ɵɵloadContentQuery<ElementRef>()) && (ctx.bars = tmp);
}
},
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});
}
@ -600,12 +600,12 @@ describe('InheritDefinitionFeature', () => {
*/
const AppComponent = createComponent('app-component', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div', [AttributeMarker.Bindings, 'sub-dir']);
ɵɵelementStart(0, 'div', [AttributeMarker.Bindings, 'sub-dir']);
{
Δelement(1, 'span', null, ['foo', '']);
Δelement(3, 'span', null, ['bar', '']);
ɵɵelement(1, 'span', null, ['foo', '']);
ɵɵelement(3, 'span', null, ['bar', '']);
}
ΔelementEnd();
ɵɵelementEnd();
}
}, 5, 0, [SubDirective]);
@ -616,7 +616,7 @@ describe('InheritDefinitionFeature', () => {
it('should throw if inheriting a component from a directive', () => {
class SuperComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SuperComponent,
template: () => {},
selectors: [['', 'superDir', '']],
@ -627,11 +627,11 @@ describe('InheritDefinitionFeature', () => {
}
expect(() => {
class SubDirective extends SuperComponent{static ngDirectiveDef = ΔdefineDirective({
class SubDirective extends SuperComponent{static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'subDir', '']],
factory: () => new SubDirective(),
features: [ΔInheritDefinitionFeature]
features: [ɵɵInheritDefinitionFeature]
});}
}).toThrowError('Directives cannot inherit Components');
});
@ -643,24 +643,24 @@ describe('InheritDefinitionFeature', () => {
// providers: [{ provide: SOME_DIRS, useClass: SuperDirective, multi: true }]
class SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SuperDirective,
selectors: [['', 'superDir', '']],
factory: () => new SuperDirective(),
features:
[ΔProvidersFeature([{provide: SOME_DIRS, useClass: SuperDirective, multi: true}])],
[ɵɵProvidersFeature([{provide: SOME_DIRS, useClass: SuperDirective, multi: true}])],
});
}
// providers: [{ provide: SOME_DIRS, useClass: SubDirective, multi: true }]
class SubDirective extends SuperDirective {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: SubDirective,
selectors: [['', 'subDir', '']],
factory: () => new SubDirective(),
features: [
ΔProvidersFeature([{provide: SOME_DIRS, useClass: SubDirective, multi: true}]),
ΔInheritDefinitionFeature
ɵɵProvidersFeature([{provide: SOME_DIRS, useClass: SubDirective, multi: true}]),
ɵɵInheritDefinitionFeature
],
});
}
@ -668,17 +668,17 @@ describe('InheritDefinitionFeature', () => {
class OtherDirective {
constructor(@Inject(SOME_DIRS) public dirs: any) {}
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: OtherDirective,
selectors: [['', 'otherDir', '']],
factory: () => otherDir = new OtherDirective(ΔdirectiveInject(SOME_DIRS)),
factory: () => otherDir = new OtherDirective(ɵɵdirectiveInject(SOME_DIRS)),
});
}
/** <div otherDir subDir></div> */
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['otherDir', '', 'subDir', '']);
ɵɵelement(0, 'div', ['otherDir', '', 'subDir', '']);
}
}, 1, 0, [OtherDirective, SubDirective, SuperDirective]);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,10 @@
*/
import 'reflect-metadata';
import {ElementRef, QueryList, ΔsetComponentScope as setComponentScope} from '@angular/core';
import {ElementRef, QueryList, ɵɵsetComponentScope as setComponentScope} from '@angular/core';
import {Injectable} from '@angular/core/src/di/injectable';
import {setCurrentInjector, Δinject} from '@angular/core/src/di/injector_compatibility';
import {ΔInjectorDef, ΔdefineInjectable} from '@angular/core/src/di/interface/defs';
import {setCurrentInjector, ɵɵinject} from '@angular/core/src/di/injector_compatibility';
import {ɵɵInjectorDef, ɵɵdefineInjectable} from '@angular/core/src/di/interface/defs';
import {ivyEnabled} from '@angular/core/src/ivy_switch';
import {ContentChild, ContentChildren, ViewChild, ViewChildren} from '@angular/core/src/metadata/di';
import {Component, Directive, HostBinding, HostListener, Input, Output, Pipe} from '@angular/core/src/metadata/directives';
@ -45,7 +45,7 @@ ivyEnabled && describe('render3 jit', () => {
expect(ServiceAny.ngInjectableDef).toBeDefined();
expect(ServiceAny.ngInjectableDef.providedIn).toBe('root');
expect(Δinject(Service) instanceof Service).toBe(true);
expect(ɵɵinject(Service) instanceof Service).toBe(true);
});
it('compiles an injectable with a useValue provider', () => {
@ -53,7 +53,7 @@ ivyEnabled && describe('render3 jit', () => {
class Service {
}
expect(Δinject(Service)).toBe('test');
expect(ɵɵinject(Service)).toBe('test');
});
it('compiles an injectable with a useExisting provider', () => {
@ -65,7 +65,7 @@ ivyEnabled && describe('render3 jit', () => {
class Service {
}
expect(Δinject(Service)).toBe('test');
expect(ɵɵinject(Service)).toBe('test');
});
it('compiles an injectable with a useFactory provider, without deps', () => {
@ -74,7 +74,7 @@ ivyEnabled && describe('render3 jit', () => {
class Service {
}
expect(Δinject(Service)).toBe('test');
expect(ɵɵinject(Service)).toBe('test');
});
it('compiles an injectable with a useFactory provider, with deps', () => {
@ -86,7 +86,7 @@ ivyEnabled && describe('render3 jit', () => {
class Service {
}
expect(Δinject(Service)).toBe('test');
expect(ɵɵinject(Service)).toBe('test');
});
it('compiles an injectable with a useClass provider, with deps', () => {
@ -104,7 +104,7 @@ ivyEnabled && describe('render3 jit', () => {
}
const ServiceAny = Service as any;
expect(Δinject(Service).value).toBe('test');
expect(ɵɵinject(Service).value).toBe('test');
});
it('compiles an injectable with a useClass provider, without deps', () => {
@ -119,8 +119,8 @@ ivyEnabled && describe('render3 jit', () => {
get value(): number { return 0; }
}
expect(Δinject(Existing).value).toBe(1);
const injected = Δinject(Service);
expect(ɵɵinject(Existing).value).toBe(1);
const injected = ɵɵinject(Service);
expect(injected instanceof Existing).toBe(true);
expect(injected.value).toBe(2);
});
@ -139,7 +139,7 @@ ivyEnabled && describe('render3 jit', () => {
class Child extends Base {
}
expect(Δinject(Child).dep instanceof Dep).toBe(true);
expect(ɵɵinject(Child).dep instanceof Dep).toBe(true);
});
it('compiles a module to a definition', () => {
@ -167,7 +167,7 @@ ivyEnabled && describe('render3 jit', () => {
it('compiles a module to an ngInjectorDef with the providers', () => {
class Token {
static ngInjectableDef = ΔdefineInjectable({
static ngInjectableDef = ɵɵdefineInjectable({
providedIn: 'root',
factory: () => 'default',
});
@ -180,7 +180,7 @@ ivyEnabled && describe('render3 jit', () => {
constructor(public token: Token) {}
}
const injectorDef: ΔInjectorDef<Module> = (Module as any).ngInjectorDef;
const injectorDef: ɵɵInjectorDef<Module> = (Module as any).ngInjectorDef;
const instance = injectorDef.factory();
// Since the instance was created outside of an injector using the module, the

View File

@ -12,12 +12,12 @@ import {Identifiers} from '@angular/compiler/src/render3/r3_identifiers';
import {angularCoreEnv} from '../../src/render3/jit/environment';
const INTERFACE_EXCEPTIONS = new Set<string>([
'ΔBaseDef',
'ΔComponentDefWithMeta',
'ΔDirectiveDefWithMeta',
'ΔInjectorDef',
'ΔNgModuleDefWithMeta',
'ΔPipeDefWithMeta',
'ɵɵBaseDef',
'ɵɵComponentDefWithMeta',
'ɵɵDirectiveDefWithMeta',
'ɵɵInjectorDef',
'ɵɵNgModuleDefWithMeta',
'ɵɵPipeDefWithMeta',
]);
describe('r3 jit environment', () => {

File diff suppressed because it is too large Load Diff

View File

@ -8,11 +8,11 @@
import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util';
import {markDirty, Δbind, ΔdefineComponent, ΔdefineDirective, Δreference, ΔresolveBody, ΔresolveDocument, ΔtextBinding} from '../../src/render3/index';
import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, ΔgetCurrentView, Δlistener, Δtext} from '../../src/render3/instructions/all';
import {markDirty, ɵɵbind, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵreference, ɵɵresolveBody, ɵɵresolveDocument, ɵɵtextBinding} from '../../src/render3/index';
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵgetCurrentView, ɵɵlistener, ɵɵtext} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {GlobalTargetResolver} from '../../src/render3/interfaces/renderer';
import {ΔrestoreView} from '../../src/render3/state';
import {ɵɵrestoreView} from '../../src/render3/state';
import {getRendererFactory2} from './imported_renderer2';
import {ComponentFixture, TemplateFixture, containerEl, createComponent, getDirectiveOnNode, renderToHtml, requestAnimationFrame} from './render_util';
@ -28,7 +28,7 @@ describe('event listeners', () => {
onClick() { this.counter++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComp,
selectors: [['comp']],
consts: 2,
@ -36,12 +36,12 @@ describe('event listeners', () => {
/** <button (click)="onClick()"> Click me </button> */
template: function CompTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
},
factory: () => {
@ -59,14 +59,14 @@ describe('event listeners', () => {
/* @HostListener('body:click') */
onBodyClick() { events.push('component - body:click'); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyCompWithGlobalListeners,
selectors: [['comp']],
consts: 1,
vars: 0,
template: function CompTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0, 'Some text');
ɵɵtext(0, 'Some text');
}
},
factory: () => {
@ -77,12 +77,12 @@ describe('event listeners', () => {
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
if (rf & RenderFlags.Create) {
Δlistener('custom', function() {
ɵɵlistener('custom', function() {
return ctx.onDocumentCustomEvent();
}, false, ΔresolveDocument as GlobalTargetResolver);
Δlistener('click', function() {
}, false, ɵɵresolveDocument as GlobalTargetResolver);
ɵɵlistener('click', function() {
return ctx.onBodyClick();
}, false, ΔresolveBody as GlobalTargetResolver);
}, false, ɵɵresolveBody as GlobalTargetResolver);
}
}
});
@ -95,19 +95,19 @@ describe('event listeners', () => {
/* @HostListener('body:click') */
onBodyClick() { events.push('directive - body:click'); }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: GlobalHostListenerDir,
selectors: [['', 'hostListenerDir', '']],
factory: function HostListenerDir_Factory() { return new GlobalHostListenerDir(); },
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
if (rf & RenderFlags.Create) {
Δlistener('custom', function() {
ɵɵlistener('custom', function() {
return ctx.onDocumentCustomEvent();
}, false, ΔresolveDocument as GlobalTargetResolver);
Δlistener('click', function() {
}, false, ɵɵresolveDocument as GlobalTargetResolver);
ɵɵlistener('click', function() {
return ctx.onBodyClick();
}, false, ΔresolveBody as GlobalTargetResolver);
}, false, ɵɵresolveBody as GlobalTargetResolver);
}
}
});
@ -129,7 +129,7 @@ describe('event listeners', () => {
return this.handlerReturnValue;
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: PreventDefaultComp,
selectors: [['prevent-default-comp']],
factory: () => new PreventDefaultComp(),
@ -138,12 +138,12 @@ describe('event listeners', () => {
/** <button (click)="onClick($event)">Click</button> */
template: (rf: RenderFlags, ctx: PreventDefaultComp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function($event: any) { return ctx.onClick($event); });
Δtext(1, 'Click');
ɵɵlistener('click', function($event: any) { return ctx.onClick($event); });
ɵɵtext(1, 'Click');
}
ΔelementEnd();
ɵɵelementEnd();
}
}
});
@ -205,15 +205,15 @@ describe('event listeners', () => {
/** <button (click)="onClick(); onClick2(); "> Click me </button> */
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() {
ɵɵlistener('click', function() {
ctx.onClick();
return ctx.onClick2();
});
Δtext(1, 'Click me');
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
}
@ -240,12 +240,12 @@ describe('event listeners', () => {
/** <button (click)="showing=!showing"> Click me </button> */
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.showing = !ctx.showing; });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.showing = !ctx.showing; });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
}
@ -269,24 +269,24 @@ describe('event listeners', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.showing) {
if (ΔembeddedViewStart(1, 2, 0)) {
ΔelementStart(0, 'button');
if (ɵɵembeddedViewStart(1, 2, 0)) {
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -320,7 +320,7 @@ describe('event listeners', () => {
onClick() { this.counter++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: AppComp,
selectors: [['app-comp']],
factory: () => new AppComp(),
@ -328,24 +328,24 @@ describe('event listeners', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.showing) {
if (ΔembeddedViewStart(0, 2, 0)) {
ΔelementStart(0, 'button');
if (ɵɵembeddedViewStart(0, 2, 0)) {
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
});
@ -381,7 +381,7 @@ describe('event listeners', () => {
onClick(index: number) { this.counters[index]++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: AppComp,
selectors: [['app-comp']],
factory: () => new AppComp(),
@ -389,24 +389,24 @@ describe('event listeners', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
for (let i = 0; i < ctx.buttons; i++) {
if (ΔembeddedViewStart(0, 2, 0)) {
ΔelementStart(0, 'button');
if (ɵɵembeddedViewStart(0, 2, 0)) {
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(i); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(i); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
});
@ -445,7 +445,7 @@ describe('event listeners', () => {
onClick(index: number) { this.counters[index]++; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: AppComp,
selectors: [['app-comp']],
factory: () => new AppComp(),
@ -453,31 +453,31 @@ describe('event listeners', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
for (let i = 0; i < ctx.buttons; i++) {
const rf1 = ΔembeddedViewStart(1, 4, 1);
const rf1 = ɵɵembeddedViewStart(1, 4, 1);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(i); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(i); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ΔelementStart(2, 'div');
{ Δtext(3); }
ΔelementEnd();
ɵɵelementEnd();
ɵɵelementStart(2, 'div');
{ ɵɵtext(3); }
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔtextBinding(3, Δbind(ctx.counters[i]));
ɵɵtextBinding(3, ɵɵbind(ctx.counters[i]));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
});
@ -523,21 +523,21 @@ describe('event listeners', () => {
/* @HostListener('click') */
onClick() { events.push('click!'); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComp,
selectors: [['comp']],
consts: 1,
vars: 0,
template: function CompTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0, 'Some text');
ɵɵtext(0, 'Some text');
}
},
factory: () => { return new MyComp(); },
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
if (rf & RenderFlags.Create) {
Δlistener('click', function() { return ctx.onClick(); });
ɵɵlistener('click', function() { return ctx.onClick(); });
}
}
});
@ -574,23 +574,23 @@ describe('event listeners', () => {
/* @HostListener('click') */
onClick() { events.push('click!'); }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: HostListenerDir,
selectors: [['', 'hostListenerDir', '']],
factory: function HostListenerDir_Factory() { return new HostListenerDir(); },
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
if (rf & RenderFlags.Create) {
Δlistener('click', function() { return ctx.onClick(); });
ɵɵlistener('click', function() { return ctx.onClick(); });
}
}
});
}
const fixture = new TemplateFixture(() => {
ΔelementStart(0, 'button', ['hostListenerDir', '']);
Δtext(1, 'Click');
ΔelementEnd();
ɵɵelementStart(0, 'button', ['hostListenerDir', '']);
ɵɵtext(1, 'Click');
ɵɵelementEnd();
}, () => {}, 2, 0, [HostListenerDir]);
const button = fixture.hostElement.querySelector('button') !;
@ -604,7 +604,7 @@ describe('event listeners', () => {
it('should support global host listeners on directives', () => {
const fixture = new TemplateFixture(() => {
Δelement(0, 'div', ['hostListenerDir', '']);
ɵɵelement(0, 'div', ['hostListenerDir', '']);
}, () => {}, 1, 0, [GlobalHostListenerDir]);
const doc = fixture.hostElement.ownerDocument !;
@ -626,7 +626,7 @@ describe('event listeners', () => {
onClick(a: any, b: any) { this.counter += a + b; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComp,
selectors: [['comp']],
consts: 2,
@ -634,12 +634,12 @@ describe('event listeners', () => {
/** <button (click)="onClick(data.a, data.b)"> Click me </button> */
template: function CompTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(ctx.data.a, ctx.data.b); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(ctx.data.a, ctx.data.b); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
},
factory: () => new MyComp()
@ -669,39 +669,39 @@ describe('event listeners', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.showing) {
let rf1 = ΔembeddedViewStart(0, 2, 0);
let rf1 = ɵɵembeddedViewStart(0, 2, 0);
if (rf1 & RenderFlags.Create) {
Δtext(0, 'Hello');
Δcontainer(1);
ɵɵtext(0, 'Hello');
ɵɵcontainer(1);
}
if (rf1 & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.button) {
let rf1 = ΔembeddedViewStart(0, 2, 0);
let rf1 = ɵɵembeddedViewStart(0, 2, 0);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(); });
Δtext(1, 'Click');
ɵɵlistener('click', function() { return ctx.onClick(); });
ɵɵtext(1, 'Click');
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -733,22 +733,22 @@ describe('event listeners', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.showing) {
let rf1 = ΔembeddedViewStart(0, 3, 0);
let rf1 = ɵɵembeddedViewStart(0, 3, 0);
if (rf1 & RenderFlags.Create) {
Δtext(0, 'Hello');
Δelement(1, 'comp');
Δelement(2, 'comp');
ɵɵtext(0, 'Hello');
ɵɵelement(1, 'comp');
ɵɵelement(2, 'comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -775,19 +775,19 @@ describe('event listeners', () => {
const ctx = {showing: true};
const fixture = new TemplateFixture(
() => { Δcontainer(0); },
() => { ɵɵcontainer(0); },
() => {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.showing) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
},
1, 0, [MyCompWithGlobalListeners]);
@ -820,56 +820,56 @@ describe('event listeners', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 3, 0);
let rf1 = ɵɵembeddedViewStart(0, 3, 0);
if (rf1 & RenderFlags.Create) {
Δtext(0, 'Hello');
Δcontainer(1);
Δcontainer(2);
ɵɵtext(0, 'Hello');
ɵɵcontainer(1);
ɵɵcontainer(2);
}
if (rf1 & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.sub1) {
let rf1 = ΔembeddedViewStart(0, 2, 0);
let rf1 = ɵɵembeddedViewStart(0, 2, 0);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.counter1++; });
Δtext(1, 'Click');
ɵɵlistener('click', function() { return ctx.counter1++; });
ɵɵtext(1, 'Click');
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshEnd();
ɵɵcontainerRefreshStart(2);
{
if (ctx.sub2) {
let rf1 = ΔembeddedViewStart(0, 2, 0);
let rf1 = ɵɵembeddedViewStart(0, 2, 0);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.counter2++; });
Δtext(1, 'Click');
ɵɵlistener('click', function() { return ctx.counter2++; });
ɵɵtext(1, 'Click');
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -907,7 +907,7 @@ describe('event listeners', () => {
onClick(comp: any) { this.comp = comp; }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: App,
selectors: [['app']],
factory: () => new App(),
@ -915,17 +915,17 @@ describe('event listeners', () => {
vars: 0,
template: (rf: RenderFlags, ctx: App) => {
if (rf & RenderFlags.Create) {
const state = ΔgetCurrentView();
Δelement(0, 'comp', null, ['comp', '']);
ΔelementStart(2, 'button');
const state = ɵɵgetCurrentView();
ɵɵelement(0, 'comp', null, ['comp', '']);
ɵɵelementStart(2, 'button');
{
Δlistener('click', function() {
ΔrestoreView(state);
const comp = Δreference(1);
ɵɵlistener('click', function() {
ɵɵrestoreView(state);
const comp = ɵɵreference(1);
return ctx.onClick(comp);
});
}
ΔelementEnd();
ɵɵelementEnd();
}
// testing only

View File

@ -8,8 +8,8 @@
import {EventEmitter} from '@angular/core';
import {ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index';
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δlistener, Δtext} from '../../src/render3/instructions/all';
import {ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index';
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵlistener, ɵɵtext} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {containerEl, renderToHtml} from './render_util';
@ -23,7 +23,7 @@ describe('outputs', () => {
change = new EventEmitter();
resetStream = new EventEmitter();
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ButtonToggle,
selectors: [['button-toggle']],
template: function(rf: RenderFlags, ctx: any) {},
@ -39,7 +39,7 @@ describe('outputs', () => {
class OtherDir {
changeStream = new EventEmitter();
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: OtherDir,
selectors: [['', 'otherDir', '']],
factory: () => otherDir = new OtherDir,
@ -51,7 +51,7 @@ describe('outputs', () => {
events: string[] = [];
ngOnDestroy() { this.events.push('destroy'); }
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: DestroyComp,
selectors: [['destroy-comp']],
consts: 0,
@ -65,7 +65,7 @@ describe('outputs', () => {
class MyButton {
click = new EventEmitter();
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyButton,
selectors: [['', 'myButton', '']],
factory: () => buttonDir = new MyButton,
@ -80,11 +80,11 @@ describe('outputs', () => {
/** <button-toggle (change)="onChange()"></button-toggle> */
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle');
ɵɵelementStart(0, 'button-toggle');
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
}
@ -103,12 +103,12 @@ describe('outputs', () => {
/** <button-toggle (change)="onChange()" (reset)="onReset()"></button-toggle> */
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle');
ɵɵelementStart(0, 'button-toggle');
{
Δlistener('change', function() { return ctx.onChange(); });
Δlistener('reset', function() { return ctx.onReset(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('reset', function() { return ctx.onReset(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
}
@ -128,11 +128,11 @@ describe('outputs', () => {
/** <button-toggle (change)="counter++"></button-toggle> */
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle');
ɵɵelementStart(0, 'button-toggle');
{
Δlistener('change', function() { return ctx.counter++; });
ɵɵlistener('change', function() { return ctx.counter++; });
}
ΔelementEnd();
ɵɵelementEnd();
}
}
@ -155,24 +155,24 @@ describe('outputs', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle');
ɵɵelementStart(0, 'button-toggle');
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -201,35 +201,35 @@ describe('outputs', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition2) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle');
ɵɵelementStart(0, 'button-toggle');
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ΔembeddedViewEnd();
ɵɵcontainerRefreshEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -257,31 +257,31 @@ describe('outputs', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 4, 0);
let rf1 = ɵɵembeddedViewStart(0, 4, 0);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ΔelementStart(2, 'button-toggle');
ɵɵelementEnd();
ɵɵelementStart(2, 'button-toggle');
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
Δelement(3, 'destroy-comp');
ɵɵelementEnd();
ɵɵelement(3, 'destroy-comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -313,11 +313,11 @@ describe('outputs', () => {
it('should fire event listeners along with outputs if they match', () => {
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button', ['myButton', '']);
ɵɵelementStart(0, 'button', ['myButton', '']);
{
Δlistener('click', function() { return ctx.onClick(); });
ɵɵlistener('click', function() { return ctx.onClick(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
}
@ -338,11 +338,11 @@ describe('outputs', () => {
/** <button-toggle (change)="onChange()" otherDir></button-toggle> */
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle', ['otherDir', '']);
ɵɵelementStart(0, 'button-toggle', ['otherDir', '']);
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
}
@ -363,7 +363,7 @@ describe('outputs', () => {
// TODO(issue/24571): remove '!'.
change !: boolean;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: OtherChangeDir,
selectors: [['', 'otherChangeDir', '']],
factory: () => otherDir = new OtherChangeDir,
@ -374,14 +374,14 @@ describe('outputs', () => {
/** <button-toggle (change)="onChange()" otherChangeDir [change]="change"></button-toggle> */
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle', ['otherChangeDir', '']);
ɵɵelementStart(0, 'button-toggle', ['otherChangeDir', '']);
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'change', Δbind(ctx.change));
ɵɵelementProperty(0, 'change', ɵɵbind(ctx.change));
}
}
@ -409,39 +409,39 @@ describe('outputs', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button');
ɵɵelementStart(0, 'button');
{
Δlistener('click', function() { return ctx.onClick(); });
Δtext(1, 'Click me');
ɵɵlistener('click', function() { return ctx.onClick(); });
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
Δcontainer(2);
ɵɵelementEnd();
ɵɵcontainer(2);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(2);
ɵɵcontainerRefreshStart(2);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button-toggle');
ɵɵelementStart(0, 'button-toggle');
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
} else {
if (ΔembeddedViewStart(1, 1, 0)) {
ΔelementStart(0, 'div', ['otherDir', '']);
if (ɵɵembeddedViewStart(1, 1, 0)) {
ɵɵelementStart(0, 'div', ['otherDir', '']);
{
Δlistener('change', function() { return ctx.onChange(); });
ɵɵlistener('change', function() { return ctx.onChange(); });
}
ΔelementEnd();
ɵɵelementEnd();
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}

View File

@ -6,14 +6,14 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Directive as _Directive, InjectionToken, OnChanges, OnDestroy, Pipe as _Pipe, PipeTransform, WrappedValue, ɵNgModuleDef as NgModuleDef, ΔdefineComponent as defineComponent, ΔdefineInjectable, ΔdefineInjector, ΔdirectiveInject as directiveInject} from '@angular/core';
import {Directive as _Directive, InjectionToken, OnChanges, OnDestroy, Pipe as _Pipe, PipeTransform, WrappedValue, ɵNgModuleDef as NgModuleDef, ɵɵdefineComponent as defineComponent, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdirectiveInject as directiveInject} from '@angular/core';
import {expect} from '@angular/platform-browser/testing/src/matchers';
import {createInjector} from '../../src/di/r3_injector';
import {ΔdefineDirective, ΔdefinePipe} from '../../src/render3/definition';
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δload, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {ɵɵdefineDirective, ɵɵdefinePipe} from '../../src/render3/definition';
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵload, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {Δpipe, ΔpipeBind1, ΔpipeBind3, ΔpipeBind4, ΔpipeBindV} from '../../src/render3/pipe';
import {ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV} from '../../src/render3/pipe';
import {RenderLog, getRendererFactory2, patchLoggingRenderer2} from './imported_renderer2';
import {ComponentFixture, TemplateFixture, createComponent, getDirectiveOnNode, renderToHtml} from './render_util';
@ -46,11 +46,11 @@ describe('pipe', () => {
it('should support interpolation', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'countingPipe');
ɵɵtext(0);
ɵɵpipe(1, 'countingPipe');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, person.name), ''));
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, person.name), ''));
}
}
@ -61,11 +61,11 @@ describe('pipe', () => {
it('should throw if pipe is not found', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'randomPipeName');
ɵɵtext(0);
ɵɵpipe(1, 'randomPipeName');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, ctx.value), ''));
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, ctx.value), ''));
}
}, 2, 3, [], pipes);
@ -83,7 +83,7 @@ describe('pipe', () => {
constructor() { this.dirProp = ''; }
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir,
selectors: [['', 'myDir', '']],
factory: () => new MyDir(),
@ -95,7 +95,7 @@ describe('pipe', () => {
class DoublePipe implements PipeTransform {
transform(value: any) { return `${value}${value}`; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'double',
type: DoublePipe,
factory: function DoublePipe_Factory() { return new DoublePipe(); },
@ -104,12 +104,12 @@ describe('pipe', () => {
function Template(rf: RenderFlags, ctx: string) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div', ['myDir', '']);
Δpipe(1, 'double');
ΔelementEnd();
ɵɵelementStart(0, 'div', ['myDir', '']);
ɵɵpipe(1, 'double');
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'elprop', Δbind(ΔpipeBind1(1, 1, ctx)));
ɵɵelementProperty(0, 'elprop', ɵɵbind(ɵɵpipeBind1(1, 1, ctx)));
directive = getDirectiveOnNode(0);
}
}
@ -120,13 +120,13 @@ describe('pipe', () => {
it('should support arguments in pipes', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'multiArgPipe');
ɵɵtext(0);
ɵɵpipe(1, 'multiArgPipe');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(
ɵɵtextBinding(
0,
Δinterpolation1('', ΔpipeBind3(1, 1, person.name, 'one', person.address !.city), ''));
ɵɵinterpolation1('', ɵɵpipeBind3(1, 1, person.name, 'one', person.address !.city), ''));
}
}
@ -137,14 +137,14 @@ describe('pipe', () => {
it('should support calling pipes with different number of arguments', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'multiArgPipe');
Δpipe(2, 'multiArgPipe');
ɵɵtext(0);
ɵɵpipe(1, 'multiArgPipe');
ɵɵpipe(2, 'multiArgPipe');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(
0, Δinterpolation1(
'', ΔpipeBind4(2, 5, ΔpipeBindV(1, 1, [person.name, 'a', 'b']), 0, 1, 2), ''));
ɵɵtextBinding(
0, ɵɵinterpolation1(
'', ɵɵpipeBind4(2, 5, ɵɵpipeBindV(1, 1, [person.name, 'a', 'b']), 0, 1, 2), ''));
}
}
@ -157,7 +157,7 @@ describe('pipe', () => {
class IdentityPipe implements PipeTransform {
transform(value: any) { return value; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'identityPipe',
type: IdentityPipe,
factory: function IdentityPipe_Factory() { return new IdentityPipe(); },
@ -166,12 +166,12 @@ describe('pipe', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δpipe(1, 'identityPipe');
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵpipe(1, 'identityPipe');
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ΔpipeBind1(1, 1, 'Megatron')));
ɵɵelementProperty(0, 'id', ɵɵbind(ɵɵpipeBind1(1, 1, 'Megatron')));
}
}
@ -186,11 +186,11 @@ describe('pipe', () => {
it('should support duplicates by using the later entry', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'duplicatePipe');
ɵɵtext(0);
ɵɵpipe(1, 'duplicatePipe');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, person.name), ''));
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, person.name), ''));
}
}
@ -202,11 +202,11 @@ describe('pipe', () => {
it('should call pure pipes only if the arguments change', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'countingPipe');
ɵɵtext(0);
ɵɵpipe(1, 'countingPipe');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, person.name), ''));
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, person.name), ''));
}
}
@ -231,11 +231,11 @@ describe('pipe', () => {
it('should call impure pipes on each change detection run', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'countingImpurePipe');
ɵɵtext(0);
ɵɵpipe(1, 'countingImpurePipe');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, person.name), ''));
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, person.name), ''));
}
}
@ -247,37 +247,37 @@ describe('pipe', () => {
it('should not cache impure pipes', () => {
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δpipe(1, 'countingImpurePipe');
ΔelementEnd();
ΔelementStart(2, 'div');
Δpipe(3, 'countingImpurePipe');
ΔelementEnd();
Δcontainer(4);
ɵɵelementStart(0, 'div');
ɵɵpipe(1, 'countingImpurePipe');
ɵɵelementEnd();
ɵɵelementStart(2, 'div');
ɵɵpipe(3, 'countingImpurePipe');
ɵɵelementEnd();
ɵɵcontainer(4);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ΔpipeBind1(1, 2, true)));
ΔelementProperty(2, 'id', Δbind(ΔpipeBind1(3, 4, true)));
pipeInstances.push(Δload<CountingImpurePipe>(1), Δload(3));
ΔcontainerRefreshStart(4);
ɵɵelementProperty(0, 'id', ɵɵbind(ɵɵpipeBind1(1, 2, true)));
ɵɵelementProperty(2, 'id', ɵɵbind(ɵɵpipeBind1(3, 4, true)));
pipeInstances.push(ɵɵload<CountingImpurePipe>(1), ɵɵload(3));
ɵɵcontainerRefreshStart(4);
{
for (let i of [1, 2]) {
let rf1 = ΔembeddedViewStart(1, 2, 3);
let rf1 = ɵɵembeddedViewStart(1, 2, 3);
{
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δpipe(1, 'countingImpurePipe');
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵpipe(1, 'countingImpurePipe');
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ΔpipeBind1(1, 1, true)));
pipeInstances.push(Δload<CountingImpurePipe>(1));
ɵɵelementProperty(0, 'id', ɵɵbind(ɵɵpipeBind1(1, 1, true)));
pipeInstances.push(ɵɵload<CountingImpurePipe>(1));
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
@ -301,7 +301,7 @@ describe('pipe', () => {
transform(value: any): any { return null; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'pipeWithOnDestroy',
type: PipeWithOnDestroy,
factory: function PipeWithOnDestroy_Factory() { return new PipeWithOnDestroy(); },
@ -311,26 +311,26 @@ describe('pipe', () => {
it('should call ngOnDestroy on pipes', () => {
function Template(rf: RenderFlags, person: Person) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
if (person.age > 20) {
let rf1 = ΔembeddedViewStart(1, 2, 3);
let rf1 = ɵɵembeddedViewStart(1, 2, 3);
{
if (rf1 & RenderFlags.Create) {
Δtext(0);
Δpipe(1, 'pipeWithOnDestroy');
ɵɵtext(0);
ɵɵpipe(1, 'pipeWithOnDestroy');
}
if (rf & RenderFlags.Update) {
ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, person.age), ''));
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, person.age), ''));
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}
const pipes = [PipeWithOnDestroy];
@ -363,11 +363,12 @@ describe('pipe', () => {
title = 'ServiceB Title';
static ngInjectableDef =
ΔdefineInjectable({providedIn: 'root', factory: () => new ServiceB()});
ɵɵdefineInjectable({providedIn: 'root', factory: () => new ServiceB()});
}
class ModuleA {
static ngInjectorDef = ΔdefineInjector({factory: () => new ModuleA(), providers: [ServiceA]});
static ngInjectorDef =
ɵɵdefineInjector({factory: () => new ModuleA(), providers: [ServiceA]});
static ngModuleDef: NgModuleDef<any> = { bootstrap: [] } as any;
}
@ -377,7 +378,7 @@ describe('pipe', () => {
transform(value: string): string { return `${value} - ${this.obj.title}`; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'myConcatPipe',
type: MyConcatPipe,
factory: () => new MyConcatPipe(directiveInject(InjectionType)),
@ -399,11 +400,11 @@ describe('pipe', () => {
// '{{ title | myConcatPipe }}'
template: (rf: RenderFlags, ctx: MyComponent) => {
if (rf & 1) {
Δtext(0);
Δpipe(1, 'myConcatPipe');
ɵɵtext(0);
ɵɵpipe(1, 'myConcatPipe');
}
if (rf & 2) {
ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, ctx.title), ''));
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, ctx.title), ''));
}
},
...overrides
@ -439,7 +440,7 @@ describe('pipe', () => {
class WrappingPipe implements PipeTransform {
transform(value: any) { return new WrappedValue('Bar'); }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'wrappingPipe',
type: WrappingPipe,
factory: function WrappingPipe_Factory() { return new WrappingPipe(); },
@ -448,11 +449,13 @@ describe('pipe', () => {
}
function createTemplate() {
Δtext(0);
Δpipe(1, 'wrappingPipe');
ɵɵtext(0);
ɵɵpipe(1, 'wrappingPipe');
}
function updateTemplate() { ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, null), '')); }
function updateTemplate() {
ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, null), ''));
}
it('should unwrap', () => {
const fixture =
@ -481,7 +484,7 @@ class CountingPipe implements PipeTransform {
transform(value: any) { return `${value} state:${this.state++}`; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'countingPipe',
type: CountingPipe,
factory: function CountingPipe_Factory() { return new CountingPipe(); },
@ -494,7 +497,7 @@ class CountingImpurePipe implements PipeTransform {
transform(value: any) { return `${value} state:${this.state++}`; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'countingImpurePipe',
type: CountingImpurePipe,
factory: function CountingImpurePipe_Factory() { return new CountingImpurePipe(); },
@ -508,7 +511,7 @@ class MultiArgPipe implements PipeTransform {
return `${value} ${arg1} ${arg2} ${arg3}`;
}
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'multiArgPipe',
type: MultiArgPipe,
factory: function MultiArgPipe_Factory() { return new MultiArgPipe(); },
@ -519,7 +522,7 @@ class MultiArgPipe implements PipeTransform {
class DuplicatePipe1 implements PipeTransform {
transform(value: any) { return `${value} from duplicate 1`; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'duplicatePipe',
type: DuplicatePipe1,
factory: function DuplicatePipe1_Factory() { return new DuplicatePipe1(); },
@ -530,7 +533,7 @@ class DuplicatePipe1 implements PipeTransform {
class DuplicatePipe2 implements PipeTransform {
transform(value: any) { return `${value} from duplicate 2`; }
static ngPipeDef = ΔdefinePipe({
static ngPipeDef = ɵɵdefinePipe({
name: 'duplicatePipe',
type: DuplicatePipe2,
factory: function DuplicatePipe2_Factory() { return new DuplicatePipe2(); },

View File

@ -8,8 +8,8 @@
import {EventEmitter} from '@angular/core';
import {ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index';
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δlistener, Δload, Δreference, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
import {ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index';
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵlistener, ɵɵload, ɵɵreference, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {ComponentFixture, createComponent, renderToHtml} from './render_util';
@ -19,10 +19,10 @@ describe('elementProperty', () => {
it('should support bindings to properties', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'span');
ɵɵelement(0, 'span');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ctx.id));
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id));
}
}, 1, 1);
@ -47,8 +47,8 @@ describe('elementProperty', () => {
function Template(rf: RenderFlags, ctx: string) {
if (rf & RenderFlags.Create) {
Δelement(0, 'span');
ΔelementProperty(0, 'id', expensive(ctx));
ɵɵelement(0, 'span');
ɵɵelementProperty(0, 'id', expensive(ctx));
}
}
@ -59,10 +59,10 @@ describe('elementProperty', () => {
it('should support interpolation for properties', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'span');
ɵɵelement(0, 'span');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δinterpolation1('_', ctx.id, '_'));
ɵɵelementProperty(0, 'id', ɵɵinterpolation1('_', ctx.id, '_'));
}
}, 1, 1);
@ -86,7 +86,7 @@ describe('elementProperty', () => {
// TODO(issue/24571): remove '!'.
disabled !: boolean;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyButton,
selectors: [['', 'myButton', '']],
factory: () => button = new MyButton(),
@ -99,7 +99,7 @@ describe('elementProperty', () => {
id !: number;
clickStream = new EventEmitter();
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: OtherDir,
selectors: [['', 'otherDir', '']],
factory: () => otherDir = new OtherDir(),
@ -112,7 +112,7 @@ describe('elementProperty', () => {
// TODO(issue/24571): remove '!'.
disabled !: boolean;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: OtherDisabledDir,
selectors: [['', 'otherDisabledDir', '']],
factory: () => otherDisabledDir = new OtherDisabledDir(),
@ -124,7 +124,7 @@ describe('elementProperty', () => {
// TODO(issue/24571): remove '!'.
idNumber !: string;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: IdDir,
selectors: [['', 'idDir', '']],
factory: () => idDir = new IdDir(),
@ -140,13 +140,13 @@ describe('elementProperty', () => {
/** <button myButton otherDir [id]="id" [disabled]="isDisabled">Click me</button> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button', ['otherDir', '', 'myButton', '']);
{ Δtext(1, 'Click me'); }
ΔelementEnd();
ɵɵelementStart(0, 'button', ['otherDir', '', 'myButton', '']);
{ ɵɵtext(1, 'Click me'); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'disabled', Δbind(ctx.isDisabled));
ΔelementProperty(0, 'id', Δbind(ctx.id));
ɵɵelementProperty(0, 'disabled', ɵɵbind(ctx.isDisabled));
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id));
}
}, 2, 2, deps);
@ -171,13 +171,13 @@ describe('elementProperty', () => {
/** <button myButton [id]="id" [disabled]="isDisabled">Click me</button> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button', ['myButton', '']);
{ Δtext(1, 'Click me'); }
ΔelementEnd();
ɵɵelementStart(0, 'button', ['myButton', '']);
{ ɵɵtext(1, 'Click me'); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'disabled', Δbind(ctx.isDisabled));
ΔelementProperty(0, 'id', Δbind(ctx.id));
ɵɵelementProperty(0, 'disabled', ɵɵbind(ctx.isDisabled));
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id));
}
}, 2, 2, deps);
@ -203,7 +203,7 @@ describe('elementProperty', () => {
// TODO(issue/24571): remove '!'.
id !: number;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
consts: 0,
@ -217,10 +217,10 @@ describe('elementProperty', () => {
/** <comp [id]="id"></comp> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ctx.id));
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id));
}
}, 1, 1, [Comp]);
@ -241,12 +241,12 @@ describe('elementProperty', () => {
/** <button myButton otherDisabledDir [disabled]="isDisabled">Click me</button> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button', ['myButton', '', 'otherDisabledDir', '']);
{ Δtext(1, 'Click me'); }
ΔelementEnd();
ɵɵelementStart(0, 'button', ['myButton', '', 'otherDisabledDir', '']);
{ ɵɵtext(1, 'Click me'); }
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'disabled', Δbind(ctx.isDisabled));
ɵɵelementProperty(0, 'disabled', ɵɵbind(ctx.isDisabled));
}
}, 2, 1, deps);
@ -268,15 +268,15 @@ describe('elementProperty', () => {
/** <button otherDir [id]="id" (click)="onClick()">Click me</button> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button', ['otherDir', '']);
ɵɵelementStart(0, 'button', ['otherDir', '']);
{
Δlistener('click', () => ctx.onClick());
Δtext(1, 'Click me');
ɵɵlistener('click', () => ctx.onClick());
ɵɵtext(1, 'Click me');
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ctx.id));
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id));
}
}, 2, 1, deps);
@ -308,40 +308,40 @@ describe('elementProperty', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'button', ['idDir', '']);
{ Δtext(1, 'Click me'); }
ΔelementEnd();
Δcontainer(2);
ɵɵelementStart(0, 'button', ['idDir', '']);
{ ɵɵtext(1, 'Click me'); }
ɵɵelementEnd();
ɵɵcontainer(2);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ctx.id1));
ΔcontainerRefreshStart(2);
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id1));
ɵɵcontainerRefreshStart(2);
{
if (ctx.condition) {
let rf0 = ΔembeddedViewStart(0, 2, 1);
let rf0 = ɵɵembeddedViewStart(0, 2, 1);
if (rf0 & RenderFlags.Create) {
ΔelementStart(0, 'button');
{ Δtext(1, 'Click me too'); }
ΔelementEnd();
ɵɵelementStart(0, 'button');
{ ɵɵtext(1, 'Click me too'); }
ɵɵelementEnd();
}
if (rf0 & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ctx.id2));
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id2));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
} else {
let rf1 = ΔembeddedViewStart(1, 2, 1);
let rf1 = ɵɵembeddedViewStart(1, 2, 1);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'button', ['otherDir', '']);
{ Δtext(1, 'Click me too'); }
ΔelementEnd();
ɵɵelementStart(0, 'button', ['otherDir', '']);
{ ɵɵtext(1, 'Click me too'); }
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔelementProperty(0, 'id', Δbind(ctx.id3));
ɵɵelementProperty(0, 'id', ɵɵbind(ctx.id3));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 3, 1, deps);
@ -375,7 +375,7 @@ describe('elementProperty', () => {
direction !: string;
changeStream = new EventEmitter();
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir,
selectors: [['', 'myDir', '']],
factory: () => myDir = new MyDir(),
@ -390,7 +390,7 @@ describe('elementProperty', () => {
// TODO(issue/24571): remove '!'.
roleB !: string;
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDirB,
selectors: [['', 'myDirB', '']],
factory: () => dirB = new MyDirB(),
@ -405,7 +405,7 @@ describe('elementProperty', () => {
/** <div role="button" myDir></div> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'button', 'myDir', '']);
ɵɵelement(0, 'div', ['role', 'button', 'myDir', '']);
}
}, 1, 0, deps);
@ -419,10 +419,10 @@ describe('elementProperty', () => {
/** <div role="button" [role]="role" myDir></div> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'button', 'myDir', '']);
ɵɵelement(0, 'div', ['role', 'button', 'myDir', '']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'role', Δbind(ctx.role));
ɵɵelementProperty(0, 'role', ɵɵbind(ctx.role));
}
}, 1, 1, deps);
@ -442,7 +442,7 @@ describe('elementProperty', () => {
/** <div role="button" myDir myDirB></div> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'button', 'myDir', '', 'myDirB', '']);
ɵɵelement(0, 'div', ['role', 'button', 'myDir', '', 'myDirB', '']);
}
}, 1, 0, deps);
@ -457,7 +457,7 @@ describe('elementProperty', () => {
/** <div role="button" dir="rtl" myDir></div> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'button', 'dir', 'rtl', 'myDir', '']);
ɵɵelement(0, 'div', ['role', 'button', 'dir', 'rtl', 'myDir', '']);
}
}, 1, 0, deps);
@ -472,9 +472,9 @@ describe('elementProperty', () => {
/** <div role="button" (change)="onChange()" myDir></div> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div', ['role', 'button', 'myDir', '']);
{ Δlistener('change', () => ctx.onChange()); }
ΔelementEnd();
ɵɵelementStart(0, 'div', ['role', 'button', 'myDir', '']);
{ ɵɵlistener('change', () => ctx.onChange()); }
ɵɵelementEnd();
}
}, 1, 0, deps);
@ -497,8 +497,8 @@ describe('elementProperty', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'button', 'dir', 'rtl', 'myDir', '']);
Δelement(1, 'div', ['role', 'listbox', 'myDirB', '']);
ɵɵelement(0, 'div', ['role', 'button', 'dir', 'rtl', 'myDir', '']);
ɵɵelement(1, 'div', ['role', 'listbox', 'myDirB', '']);
}
}, 2, 0, deps);
@ -523,27 +523,27 @@ describe('elementProperty', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'listbox', 'myDir', '']);
Δcontainer(1);
ɵɵelement(0, 'div', ['role', 'listbox', 'myDir', '']);
ɵɵcontainer(1);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (ctx.condition) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'button', 'myDirB', '']);
ɵɵelement(0, 'div', ['role', 'button', 'myDirB', '']);
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
} else {
let rf2 = ΔembeddedViewStart(1, 1, 0);
let rf2 = ɵɵembeddedViewStart(1, 1, 0);
if (rf2 & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'menu']);
ɵɵelement(0, 'div', ['role', 'menu']);
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 2, 0, deps);
@ -565,7 +565,7 @@ describe('elementProperty', () => {
it('should process attributes properly inside a for loop', () => {
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
consts: 3,
@ -573,12 +573,12 @@ describe('elementProperty', () => {
/** <div role="button" dir #dir="myDir"></div> {{ dir.role }} */
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div', ['role', 'button', 'myDir', ''], ['dir', 'myDir']);
Δtext(2);
ɵɵelement(0, 'div', ['role', 'button', 'myDir', ''], ['dir', 'myDir']);
ɵɵtext(2);
}
if (rf & RenderFlags.Update) {
const tmp = Δreference(1) as any;
ΔtextBinding(2, Δbind(tmp.role));
const tmp = ɵɵreference(1) as any;
ɵɵtextBinding(2, ɵɵbind(tmp.role));
}
},
factory: () => new Comp(),
@ -593,20 +593,20 @@ describe('elementProperty', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
for (let i = 0; i < 2; i++) {
let rf1 = ΔembeddedViewStart(0, 1, 0);
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
if (rf1 & RenderFlags.Create) {
Δelement(0, 'comp');
ɵɵelement(0, 'comp');
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}, 1, 0, [Comp]);

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,10 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {AttributeMarker, ΔdefineComponent, Δtemplate} from '../../src/render3/index';
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, ΔnextContext} from '../../src/render3/instructions/all';
import {AttributeMarker, ɵɵdefineComponent, ɵɵtemplate} from '../../src/render3/index';
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵnextContext} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {ΔpureFunction1, ΔpureFunction2, ΔpureFunction3, ΔpureFunction4, ΔpureFunction5, ΔpureFunction6, ΔpureFunction7, ΔpureFunction8, ΔpureFunctionV} from '../../src/render3/pure_function';
import {ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV} from '../../src/render3/pure_function';
import {ComponentFixture, createComponent, getDirectiveOnNode, renderToHtml} from '../../test/render3/render_util';
import {NgIf} from './common_with_def';
@ -20,7 +20,7 @@ describe('array literals', () => {
// TODO(issue/24571): remove '!'.
names !: string[];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: MyComp,
selectors: [['my-comp']],
factory: function MyComp_Factory() { return myComp = new MyComp(); },
@ -39,10 +39,10 @@ describe('array literals', () => {
/** <my-comp [names]="['Nancy', customName, 'Bess']"></my-comp> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'my-comp');
ɵɵelement(0, 'my-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'names', Δbind(ΔpureFunction1(1, e0_ff, ctx.customName)));
ɵɵelementProperty(0, 'names', ɵɵbind(ɵɵpureFunction1(1, e0_ff, ctx.customName)));
}
}, 1, 3, directives);
@ -75,11 +75,11 @@ describe('array literals', () => {
function IfTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'my-comp');
ɵɵelement(0, 'my-comp');
}
if (rf & RenderFlags.Update) {
const comp = ΔnextContext();
ΔelementProperty(0, 'names', Δbind(ΔpureFunction1(1, e0_ff, comp.customName)));
const comp = ɵɵnextContext();
ɵɵelementProperty(0, 'names', ɵɵbind(ɵɵpureFunction1(1, e0_ff, comp.customName)));
}
}
@ -88,12 +88,12 @@ describe('array literals', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(
ɵɵtemplate(
0, IfTemplate, 1, 3, 'my-comp',
[AttributeMarker.Bindings, 'names', AttributeMarker.Template, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngIf', Δbind(ctx.showing));
ɵɵelementProperty(0, 'ngIf', ɵɵbind(ctx.showing));
}
}, 1, 1, [MyComp, NgIf]);
@ -114,7 +114,7 @@ describe('array literals', () => {
// TODO(issue/24571): remove '!'.
names2 !: string[];
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ManyPropComp,
selectors: [['many-prop-comp']],
factory: function ManyPropComp_Factory() { return manyPropComp = new ManyPropComp(); },
@ -134,11 +134,11 @@ describe('array literals', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'many-prop-comp');
ɵɵelement(0, 'many-prop-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'names1', Δbind(ΔpureFunction1(2, e0_ff, ctx.customName)));
ΔelementProperty(0, 'names2', Δbind(ΔpureFunction1(4, e0_ff_1, ctx.customName2)));
ɵɵelementProperty(0, 'names1', ɵɵbind(ɵɵpureFunction1(2, e0_ff, ctx.customName)));
ɵɵelementProperty(0, 'names2', ɵɵbind(ɵɵpureFunction1(4, e0_ff_1, ctx.customName2)));
}
}, 1, 6, [ManyPropComp]);
@ -170,7 +170,7 @@ describe('array literals', () => {
return arr;
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ParentComp,
selectors: [['parent-comp']],
factory: () => new ParentComp(),
@ -178,13 +178,13 @@ describe('array literals', () => {
vars: 3,
template: function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'my-comp');
ɵɵelementStart(0, 'my-comp');
myComps.push(getDirectiveOnNode(0));
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(
0, 'names', Δbind(ctx.someFn(ΔpureFunction1(1, e0_ff, ctx.customName))));
ɵɵelementProperty(
0, 'names', ɵɵbind(ctx.someFn(ɵɵpureFunction1(1, e0_ff, ctx.customName))));
}
},
directives: directives
@ -193,8 +193,8 @@ describe('array literals', () => {
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'parent-comp');
Δelement(1, 'parent-comp');
ɵɵelement(0, 'parent-comp');
ɵɵelement(1, 'parent-comp');
}
}, 2, 0, [ParentComp]);
@ -218,11 +218,11 @@ describe('array literals', () => {
/** <my-comp [names]="['Nancy', customName, 'Bess', customName2]"></my-comp> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'my-comp');
ɵɵelement(0, 'my-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(
0, 'names', Δbind(ΔpureFunction2(1, e0_ff, ctx.customName, ctx.customName2)));
ɵɵelementProperty(
0, 'names', ɵɵbind(ɵɵpureFunction2(1, e0_ff, ctx.customName, ctx.customName2)));
}
}, 1, 4, directives);
@ -279,37 +279,38 @@ describe('array literals', () => {
function Template(rf: RenderFlags, c: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'my-comp');
ɵɵelementStart(0, 'my-comp');
f3Comp = getDirectiveOnNode(0);
ΔelementEnd();
ΔelementStart(1, 'my-comp');
ɵɵelementEnd();
ɵɵelementStart(1, 'my-comp');
f4Comp = getDirectiveOnNode(1);
ΔelementEnd();
ΔelementStart(2, 'my-comp');
ɵɵelementEnd();
ɵɵelementStart(2, 'my-comp');
f5Comp = getDirectiveOnNode(2);
ΔelementEnd();
ΔelementStart(3, 'my-comp');
ɵɵelementEnd();
ɵɵelementStart(3, 'my-comp');
f6Comp = getDirectiveOnNode(3);
ΔelementEnd();
ΔelementStart(4, 'my-comp');
ɵɵelementEnd();
ɵɵelementStart(4, 'my-comp');
f7Comp = getDirectiveOnNode(4);
ΔelementEnd();
ΔelementStart(5, 'my-comp');
ɵɵelementEnd();
ɵɵelementStart(5, 'my-comp');
f8Comp = getDirectiveOnNode(5);
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'names', Δbind(ΔpureFunction3(6, e0_ff, c[5], c[6], c[7])));
ΔelementProperty(1, 'names', Δbind(ΔpureFunction4(10, e2_ff, c[4], c[5], c[6], c[7])));
ΔelementProperty(
2, 'names', Δbind(ΔpureFunction5(15, e4_ff, c[3], c[4], c[5], c[6], c[7])));
ΔelementProperty(
3, 'names', Δbind(ΔpureFunction6(21, e6_ff, c[2], c[3], c[4], c[5], c[6], c[7])));
ΔelementProperty(
4, 'names', Δbind(ΔpureFunction7(28, e8_ff, c[1], c[2], c[3], c[4], c[5], c[6], c[7])));
ΔelementProperty(
ɵɵelementProperty(0, 'names', ɵɵbind(ɵɵpureFunction3(6, e0_ff, c[5], c[6], c[7])));
ɵɵelementProperty(1, 'names', ɵɵbind(ɵɵpureFunction4(10, e2_ff, c[4], c[5], c[6], c[7])));
ɵɵelementProperty(
2, 'names', ɵɵbind(ɵɵpureFunction5(15, e4_ff, c[3], c[4], c[5], c[6], c[7])));
ɵɵelementProperty(
3, 'names', ɵɵbind(ɵɵpureFunction6(21, e6_ff, c[2], c[3], c[4], c[5], c[6], c[7])));
ɵɵelementProperty(
4, 'names',
ɵɵbind(ɵɵpureFunction7(28, e8_ff, c[1], c[2], c[3], c[4], c[5], c[6], c[7])));
ɵɵelementProperty(
5, 'names',
Δbind(ΔpureFunction8(36, e10_ff, c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7])));
ɵɵbind(ɵɵpureFunction8(36, e10_ff, c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7])));
}
}
@ -352,12 +353,12 @@ describe('array literals', () => {
*/
function Template(rf: RenderFlags, c: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'my-comp');
ɵɵelement(0, 'my-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(
0, 'names', Δbind(ΔpureFunctionV(3, e0_ff, [
c[0], c[1], c[2], c[3], ΔpureFunction1(1, e0_ff_1, c[4]), c[5], c[6], c[7], c[8]
ɵɵelementProperty(
0, 'names', ɵɵbind(ɵɵpureFunctionV(3, e0_ff, [
c[0], c[1], c[2], c[3], ɵɵpureFunction1(1, e0_ff_1, c[4]), c[5], c[6], c[7], c[8]
])));
}
}
@ -386,7 +387,7 @@ describe('object literals', () => {
// TODO(issue/24571): remove '!'.
config !: {[key: string]: any};
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: ObjectComp,
selectors: [['object-comp']],
factory: function ObjectComp_Factory() { return objectComp = new ObjectComp(); },
@ -405,10 +406,10 @@ describe('object literals', () => {
/** <object-comp [config]="{duration: 500, animation: name}"></object-comp> */
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'object-comp');
ɵɵelement(0, 'object-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'config', Δbind(ΔpureFunction1(1, e0_ff, ctx.name)));
ɵɵelementProperty(0, 'config', ɵɵbind(ɵɵpureFunction1(1, e0_ff, ctx.name)));
}
}, 1, 3, defs);
@ -442,14 +443,14 @@ describe('object literals', () => {
*/
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'object-comp');
ɵɵelement(0, 'object-comp');
}
if (rf & RenderFlags.Update) {
ΔelementProperty(
ɵɵelementProperty(
0, 'config',
Δbind(ΔpureFunction2(
ɵɵbind(ɵɵpureFunction2(
5, e0_ff, ctx.name,
ΔpureFunction1(3, e0_ff_1, ΔpureFunction1(1, e0_ff_2, ctx.duration)))));
ɵɵpureFunction1(3, e0_ff_1, ɵɵpureFunction1(1, e0_ff_2, ctx.duration)))));
}
}, 1, 8, defs);
@ -511,27 +512,27 @@ describe('object literals', () => {
*/
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δcontainer(0);
ɵɵcontainer(0);
}
if (rf & RenderFlags.Update) {
ΔcontainerRefreshStart(0);
ɵɵcontainerRefreshStart(0);
{
for (let i = 0; i < 2; i++) {
let rf1 = ΔembeddedViewStart(0, 1, 4);
let rf1 = ɵɵembeddedViewStart(0, 1, 4);
if (rf1 & RenderFlags.Create) {
ΔelementStart(0, 'object-comp');
ɵɵelementStart(0, 'object-comp');
objectComps.push(getDirectiveOnNode(0));
ΔelementEnd();
ɵɵelementEnd();
}
if (rf1 & RenderFlags.Update) {
ΔelementProperty(
0, 'config',
Δbind(ΔpureFunction2(1, e0_ff, ctx.configs[i].opacity, ctx.configs[i].duration)));
ɵɵelementProperty(
0, 'config', ɵɵbind(ɵɵpureFunction2(
1, e0_ff, ctx.configs[i].opacity, ctx.configs[i].duration)));
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ import {CreateComponentOptions} from '../../src/render3/component';
import {getDirectivesAtNodeIndex, getLContext, isComponentInstance} from '../../src/render3/context_discovery';
import {extractDirectiveDef, extractPipeDef} from '../../src/render3/definition';
import {NG_ELEMENT_ID} from '../../src/render3/fields';
import {ComponentTemplate, ComponentType, DirectiveDef, DirectiveType, RenderFlags, renderComponent as _renderComponent, tick, ΔProvidersFeature, ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index';
import {ComponentTemplate, ComponentType, DirectiveDef, DirectiveType, RenderFlags, renderComponent as _renderComponent, tick, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index';
import {DirectiveDefList, DirectiveTypesOrFactory, HostBindingsFunction, PipeDef, PipeDefList, PipeTypesOrFactory} from '../../src/render3/interfaces/definition';
import {PlayerHandler} from '../../src/render3/interfaces/player';
import {ProceduralRenderer3, RComment, RElement, RNode, RText, Renderer3, RendererFactory3, RendererStyleFlags3, domRendererFactory3} from '../../src/render3/interfaces/renderer';
@ -317,7 +317,7 @@ export function createComponent(
viewProviders: Provider[] = [], hostBindings?: HostBindingsFunction<any>): ComponentType<any> {
return class Component {
value: any;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Component,
selectors: [[name]],
consts: consts,
@ -328,7 +328,7 @@ export function createComponent(
directives: directives, hostBindings,
pipes: pipes,
features: (providers.length > 0 || viewProviders.length > 0)?
[ΔProvidersFeature(providers || [], viewProviders || [])]: []
[ɵɵProvidersFeature(providers || [], viewProviders || [])]: []
});
};
}
@ -336,7 +336,7 @@ export function createComponent(
export function createDirective(
name: string, {exportAs}: {exportAs?: string[]} = {}): DirectiveType<any> {
return class Directive {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: Directive,
selectors: [['', name, '']],
factory: () => new Directive(),

View File

@ -10,8 +10,8 @@ import {AnimationEvent} from '@angular/animations';
import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing';
import {RendererType2, ViewEncapsulation} from '../../src/core';
import {ΔdefineComponent} from '../../src/render3/index';
import {tick, Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δlistener, Δtext} from '../../src/render3/instructions/all';
import {ɵɵdefineComponent} from '../../src/render3/index';
import {tick, ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵlistener, ɵɵtext} from '../../src/render3/instructions/all';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {getAnimationRendererFactory2, getRendererFactory2} from './imported_renderer2';
@ -29,7 +29,7 @@ describe('renderer factory lifecycle', () => {
rendererFactory.end = () => logs.push('end');
class SomeComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SomeComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['some-component']],
@ -38,7 +38,7 @@ describe('renderer factory lifecycle', () => {
template: function(rf: RenderFlags, ctx: SomeComponent) {
if (rf & RenderFlags.Create) {
logs.push('component create');
Δtext(0, 'foo');
ɵɵtext(0, 'foo');
}
if (rf & RenderFlags.Update) {
logs.push('component update');
@ -49,7 +49,7 @@ describe('renderer factory lifecycle', () => {
}
class SomeComponentWhichThrows {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SomeComponentWhichThrows,
encapsulation: ViewEncapsulation.None,
selectors: [['some-component-with-Error']],
@ -65,7 +65,7 @@ describe('renderer factory lifecycle', () => {
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
logs.push('function create');
Δtext(0, 'bar');
ɵɵtext(0, 'bar');
}
if (rf & RenderFlags.Update) {
logs.push('function update');
@ -77,8 +77,8 @@ describe('renderer factory lifecycle', () => {
function TemplateWithComponent(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
logs.push('function_with_component create');
Δtext(0, 'bar');
Δelement(1, 'some-component');
ɵɵtext(0, 'bar');
ɵɵelement(1, 'some-component');
}
if (rf & RenderFlags.Update) {
logs.push('function_with_component update');
@ -139,7 +139,7 @@ describe('animation renderer factory', () => {
});
class SomeComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SomeComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['some-component']],
@ -147,7 +147,7 @@ describe('animation renderer factory', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: SomeComponent) {
if (rf & RenderFlags.Create) {
Δtext(0, 'foo');
ɵɵtext(0, 'foo');
}
},
factory: () => new SomeComponent
@ -160,23 +160,23 @@ describe('animation renderer factory', () => {
callback(event: AnimationEvent) {
eventLogs.push(`${event.fromState ? event.fromState : event.toState} - ${event.phaseName}`);
}
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SomeComponentWithAnimation,
selectors: [['some-component']],
consts: 2,
vars: 1,
template: function(rf: RenderFlags, ctx: SomeComponentWithAnimation) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ɵɵelementStart(0, 'div');
{
Δlistener('@myAnimation.start', ctx.callback.bind(ctx));
Δlistener('@myAnimation.done', ctx.callback.bind(ctx));
Δtext(1, 'foo');
ɵɵlistener('@myAnimation.start', ctx.callback.bind(ctx));
ɵɵlistener('@myAnimation.done', ctx.callback.bind(ctx));
ɵɵtext(1, 'foo');
}
ΔelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, '@myAnimation', Δbind(ctx.exp));
ɵɵelementProperty(0, '@myAnimation', ɵɵbind(ctx.exp));
}
},
factory: () => new SomeComponentWithAnimation,
@ -234,27 +234,27 @@ describe('Renderer2 destruction hooks', () => {
let condition = true;
function createTemplate() {
ΔelementStart(0, 'div');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
function updateTemplate() {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (condition) {
let rf1 = ΔembeddedViewStart(1, 3, 0);
let rf1 = ɵɵembeddedViewStart(1, 3, 0);
{
if (rf1 & RenderFlags.Create) {
Δelement(0, 'span');
Δelement(1, 'span');
Δelement(2, 'span');
ɵɵelement(0, 'span');
ɵɵelement(1, 'span');
ɵɵelement(2, 'span');
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
const t = new TemplateFixture(
@ -270,7 +270,7 @@ describe('Renderer2 destruction hooks', () => {
it('should call renderer.destroy for each component destroyed', () => {
class SimpleComponent {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SimpleComponent,
encapsulation: ViewEncapsulation.None,
selectors: [['simple']],
@ -278,7 +278,7 @@ describe('Renderer2 destruction hooks', () => {
vars: 0,
template: function(rf: RenderFlags, ctx: SimpleComponent) {
if (rf & RenderFlags.Create) {
Δelement(0, 'span');
ɵɵelement(0, 'span');
}
},
factory: () => new SimpleComponent,
@ -288,27 +288,27 @@ describe('Renderer2 destruction hooks', () => {
let condition = true;
function createTemplate() {
ΔelementStart(0, 'div');
{ Δcontainer(1); }
ΔelementEnd();
ɵɵelementStart(0, 'div');
{ ɵɵcontainer(1); }
ɵɵelementEnd();
}
function updateTemplate() {
ΔcontainerRefreshStart(1);
ɵɵcontainerRefreshStart(1);
{
if (condition) {
let rf1 = ΔembeddedViewStart(1, 3, 0);
let rf1 = ɵɵembeddedViewStart(1, 3, 0);
{
if (rf1 & RenderFlags.Create) {
Δelement(0, 'simple');
Δelement(1, 'span');
Δelement(2, 'simple');
ɵɵelement(0, 'simple');
ɵɵelement(1, 'span');
ɵɵelement(2, 'simple');
}
}
ΔembeddedViewEnd();
ɵɵembeddedViewEnd();
}
}
ΔcontainerRefreshEnd();
ɵɵcontainerRefreshEnd();
}
const t = new TemplateFixture(

View File

@ -9,7 +9,7 @@ import {createLView, createTView} from '@angular/core/src/render3/instructions/s
import {createRootContext} from '../../../src/render3/component';
import {getLContext} from '../../../src/render3/context_discovery';
import {ΔdefineComponent, ΔdefineDirective, ΔelementClassProp, ΔelementEnd, ΔelementHostClassProp, ΔelementHostStyleProp, ΔelementHostStyling, ΔelementHostStylingApply, ΔelementStart, ΔelementStyleProp, ΔelementStyling, ΔelementStylingApply, ΔelementStylingMap, ΔnamespaceSVG} from '../../../src/render3/index';
import {ɵɵdefineComponent, ɵɵdefineDirective, ɵɵelementClassProp, ɵɵelementEnd, ɵɵelementHostClassProp, ɵɵelementHostStyleProp, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementStart, ɵɵelementStyleProp, ɵɵelementStyling, ɵɵelementStylingApply, ɵɵelementStylingMap, ɵɵnamespaceSVG} from '../../../src/render3/index';
import {RenderFlags} from '../../../src/render3/interfaces/definition';
import {AttributeMarker, TAttributes} from '../../../src/render3/interfaces/node';
import {BindingStore, BindingType, PlayState, Player, PlayerContext, PlayerFactory, PlayerHandler} from '../../../src/render3/interfaces/player';
@ -22,7 +22,7 @@ import {CorePlayerHandler} from '../../../src/render3/styling/core_player_handle
import {registerHostDirective} from '../../../src/render3/styling/host_instructions_queue';
import {BoundPlayerFactory, bindPlayerFactory} from '../../../src/render3/styling/player_factory';
import {allocStylingContext, createEmptyStylingContext} from '../../../src/render3/styling/util';
import {ΔdefaultStyleSanitizer} from '../../../src/sanitization/sanitization';
import {ɵɵdefaultStyleSanitizer} from '../../../src/sanitization/sanitization';
import {StyleSanitizeFn} from '../../../src/sanitization/style_sanitizer';
import {ComponentFixture, renderToHtml} from '../render_util';
@ -376,7 +376,7 @@ describe('style and class based bindings', () => {
() => {
function Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'span', [
ɵɵelementStart(0, 'span', [
AttributeMarker.Styles,
'width',
'200px',
@ -385,13 +385,13 @@ describe('style and class based bindings', () => {
'opacity',
'0.5',
]);
ΔelementStyling(null, ['width']);
ΔelementEnd();
ɵɵelementStyling(null, ['width']);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStylingMap(0, null, ctx.myStyles);
ΔelementStyleProp(0, 0, ctx.myWidth);
ΔelementStylingApply(0);
ɵɵelementStylingMap(0, null, ctx.myStyles);
ɵɵelementStyleProp(0, 0, ctx.myWidth);
ɵɵelementStylingApply(0);
}
}
@ -411,7 +411,7 @@ describe('style and class based bindings', () => {
class Comp {
diameter: number = 100;
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -419,17 +419,17 @@ describe('style and class based bindings', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
ΔnamespaceSVG();
ΔelementStart(0, 'svg');
ΔelementStyling(null, ['width', 'height']);
ΔelementStart(1, 'circle', ['stroke', 'green', 'fill', 'yellow']);
ΔelementEnd();
ΔelementEnd();
ɵɵnamespaceSVG();
ɵɵelementStart(0, 'svg');
ɵɵelementStyling(null, ['width', 'height']);
ɵɵelementStart(1, 'circle', ['stroke', 'green', 'fill', 'yellow']);
ɵɵelementEnd();
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStyleProp(0, 0, ctx.diameter, 'px');
ΔelementStyleProp(0, 1, ctx.diameter, 'px');
ΔelementStylingApply(0);
ɵɵelementStyleProp(0, 0, ctx.diameter, 'px');
ɵɵelementStyleProp(0, 1, ctx.diameter, 'px');
ɵɵelementStylingApply(0);
}
}
});
@ -453,7 +453,7 @@ describe('style and class based bindings', () => {
borderWidth: string = '3px';
borderColor: string = 'red';
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
factory: () => new Comp(),
@ -461,14 +461,14 @@ describe('style and class based bindings', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ΔelementStyling(null, ['borderWidth', 'border-color']);
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵelementStyling(null, ['borderWidth', 'border-color']);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStyleProp(0, 0, ctx.borderWidth);
ΔelementStyleProp(0, 1, ctx.borderColor);
ΔelementStylingApply(0);
ɵɵelementStyleProp(0, 0, ctx.borderWidth);
ɵɵelementStyleProp(0, 1, ctx.borderColor);
ɵɵelementStylingApply(0);
}
}
});
@ -1269,7 +1269,7 @@ describe('style and class based bindings', () => {
() => {
const getStyles = trackStylesFactory();
const styleBindings = ['border-image', 'border-width'];
const styleSanitizer = ΔdefaultStyleSanitizer;
const styleSanitizer = ɵɵdefaultStyleSanitizer;
const stylingContext =
createStylingContext(null, styleBindings, null, null, styleSanitizer);
@ -3086,7 +3086,7 @@ describe('style and class based bindings', () => {
const fooFactory = bindPlayerFactory(classBuildFn, true);
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
directives: [Comp],
@ -3095,15 +3095,15 @@ describe('style and class based bindings', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ΔelementStyling(['foo'], ['width']);
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵelementStyling(['foo'], ['width']);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStylingMap(0, classMapFactory, styleMapFactory);
ΔelementStyleProp(0, 0, widthFactory);
ΔelementClassProp(0, 0, fooFactory);
ΔelementStylingApply(0);
ɵɵelementStylingMap(0, classMapFactory, styleMapFactory);
ɵɵelementStyleProp(0, 0, widthFactory);
ɵɵelementClassProp(0, 0, fooFactory);
ɵɵelementStylingApply(0);
}
}
});
@ -3159,7 +3159,7 @@ describe('style and class based bindings', () => {
let fooFactory = bindPlayerFactory(buildFn, true) as BoundPlayerFactory<any>;
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
directives: [Comp],
@ -3168,15 +3168,15 @@ describe('style and class based bindings', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ΔelementStyling(['foo'], ['width']);
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵelementStyling(['foo'], ['width']);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStylingMap(0, classMapFactory, styleMapFactory);
ΔelementStyleProp(0, 0, widthFactory);
ΔelementClassProp(0, 0, fooFactory);
ΔelementStylingApply(0);
ɵɵelementStylingMap(0, classMapFactory, styleMapFactory);
ɵɵelementStyleProp(0, 0, widthFactory);
ɵɵelementClassProp(0, 0, fooFactory);
ɵɵelementStylingApply(0);
}
}
});
@ -3234,18 +3234,18 @@ describe('style and class based bindings', () => {
const fooFactory2 = bindPlayerFactory(classBuildFn, true);
class MyDir {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: MyDir,
selectors: [['', 'my-dir', '']],
factory: () => new MyDir(),
hostBindings: function(rf: RenderFlags, ctx: MyDir, elementIndex: number) {
if (rf & RenderFlags.Create) {
ΔelementHostStyling(['foo'], ['width']);
ɵɵelementHostStyling(['foo'], ['width']);
}
if (rf & RenderFlags.Update) {
ΔelementHostStyleProp(0, ctx.widthFactory);
ΔelementHostClassProp(0, ctx.fooFactory);
ΔelementHostStylingApply();
ɵɵelementHostStyleProp(0, ctx.widthFactory);
ɵɵelementHostClassProp(0, ctx.fooFactory);
ɵɵelementHostStylingApply();
}
}
});
@ -3255,7 +3255,7 @@ describe('style and class based bindings', () => {
}
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
selectors: [['comp']],
directives: [Comp, MyDir],
@ -3264,14 +3264,14 @@ describe('style and class based bindings', () => {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div', ['my-dir', '']);
ΔelementStyling(['foo'], ['width']);
ΔelementEnd();
ɵɵelementStart(0, 'div', ['my-dir', '']);
ɵɵelementStyling(['foo'], ['width']);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStyleProp(0, 0, ctx.widthFactory);
ΔelementClassProp(0, 0, ctx.fooFactory);
ΔelementStylingApply(0);
ɵɵelementStyleProp(0, 0, ctx.widthFactory);
ɵɵelementClassProp(0, 0, ctx.fooFactory);
ɵɵelementStylingApply(0);
}
}
});

View File

@ -8,12 +8,12 @@
import {QueryList} from '@angular/core';
import {RenderFlags} from '@angular/core/src/render3';
import {getHostElement, ΔdefineComponent, ΔloadViewQuery, ΔviewQuery} from '../../../src/render3/index';
import {markDirty, Δelement, ΔelementEnd, ΔelementStart, ΔelementStyling, ΔelementStylingApply} from '../../../src/render3/instructions/all';
import {getHostElement, ɵɵdefineComponent, ɵɵloadViewQuery, ɵɵviewQuery} from '../../../src/render3/index';
import {markDirty, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵelementStyling, ɵɵelementStylingApply} from '../../../src/render3/instructions/all';
import {PlayState, Player, PlayerHandler} from '../../../src/render3/interfaces/player';
import {RElement} from '../../../src/render3/interfaces/renderer';
import {addPlayer, getPlayers} from '../../../src/render3/players';
import {ΔqueryRefresh} from '../../../src/render3/query';
import {ɵɵqueryRefresh} from '../../../src/render3/query';
import {getOrCreatePlayerContext} from '../../../src/render3/styling/util';
import {ComponentFixture} from '../render_util';
@ -228,7 +228,7 @@ function buildElementWithStyling() {
}
class Comp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: Comp,
exportAs: ['child'],
selectors: [['child-comp']],
@ -237,7 +237,7 @@ class Comp {
vars: 0,
template: (rf: RenderFlags, ctx: Comp) => {
if (rf & RenderFlags.Create) {
Δelement(0, 'div');
ɵɵelement(0, 'div');
}
ctx.logger();
}
@ -248,7 +248,7 @@ class Comp {
}
class CompWithStyling {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: CompWithStyling,
exportAs: ['child-styled'],
selectors: [['child-styled-comp']],
@ -257,12 +257,12 @@ class CompWithStyling {
vars: 0,
template: (rf: RenderFlags, ctx: CompWithStyling) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
ΔelementStyling(['fooClass']);
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵelementStyling(['fooClass']);
ɵɵelementEnd();
}
if (rf & RenderFlags.Update) {
ΔelementStylingApply(0);
ɵɵelementStylingApply(0);
}
}
});
@ -271,7 +271,7 @@ class CompWithStyling {
}
class SuperComp {
static ngComponentDef = ΔdefineComponent({
static ngComponentDef = ɵɵdefineComponent({
type: SuperComp,
selectors: [['super-comp']],
factory: () => new SuperComp(),
@ -279,18 +279,18 @@ class SuperComp {
vars: 0,
template: (rf: RenderFlags, ctx: SuperComp) => {
if (rf & RenderFlags.Create) {
ΔelementStart(0, 'div');
Δelement(1, 'child-comp', ['child', ''], ['child', 'child']);
ΔelementEnd();
ɵɵelementStart(0, 'div');
ɵɵelement(1, 'child-comp', ['child', ''], ['child', 'child']);
ɵɵelementEnd();
}
},
viewQuery: function(rf: RenderFlags, ctx: SuperComp) {
if (rf & RenderFlags.Create) {
ΔviewQuery(['child'], true, null);
ɵɵviewQuery(['child'], true, null);
}
if (rf & RenderFlags.Update) {
let tmp: any;
ΔqueryRefresh(tmp = ΔloadViewQuery<QueryList<any>>()) &&
ɵɵqueryRefresh(tmp = ɵɵloadViewQuery<QueryList<any>>()) &&
(ctx.query = tmp as QueryList<any>);
}
},

View File

@ -8,8 +8,8 @@
import {TemplateRef} from '@angular/core';
import {AttributeMarker, RenderFlags, ΔdefineDirective} from '../../src/render3/index';
import {Δbind, ΔdirectiveInject, Δelement, ΔelementContainerEnd, ΔelementContainerStart, ΔelementProperty, Δtemplate, Δtext} from '../../src/render3/instructions/all';
import {AttributeMarker, RenderFlags, ɵɵdefineDirective} from '../../src/render3/index';
import {ɵɵbind, ɵɵdirectiveInject, ɵɵelement, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementProperty, ɵɵtemplate, ɵɵtext} from '../../src/render3/instructions/all';
import {NgIf} from './common_with_def';
import {ComponentFixture, createComponent, getDirectiveOnNode} from './render_util';
@ -19,10 +19,10 @@ describe('TemplateRef', () => {
describe('rootNodes', () => {
class DirectiveWithTplRef {
static ngDirectiveDef = ΔdefineDirective({
static ngDirectiveDef = ɵɵdefineDirective({
type: DirectiveWithTplRef,
selectors: [['', 'tplRef', '']],
factory: () => new DirectiveWithTplRef(ΔdirectiveInject(TemplateRef as any))
factory: () => new DirectiveWithTplRef(ɵɵdirectiveInject(TemplateRef as any))
});
// injecting a ViewContainerRef to create a dynamic container in which embedded views will be
@ -35,9 +35,9 @@ describe('TemplateRef', () => {
function embeddedTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δelement(0, 'div');
Δtext(1, 'some text');
Δelement(2, 'span');
ɵɵelement(0, 'div');
ɵɵtext(1, 'some text');
ɵɵelement(2, 'span');
}
}
@ -50,7 +50,7 @@ describe('TemplateRef', () => {
*/
const AppComponent = createComponent('app-cmp', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(0, embeddedTemplate, 3, 0, 'ng-template', ['tplRef', '']);
ɵɵtemplate(0, embeddedTemplate, 3, 0, 'ng-template', ['tplRef', '']);
directiveWithTplRef = getDirectiveOnNode(0, 0);
}
}, 1, 0, [DirectiveWithTplRef]);
@ -79,7 +79,7 @@ describe('TemplateRef', () => {
*/
const AppComponent = createComponent('app-cmp', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(0, () => {}, 0, 0, 'ng-template', ['tplRef', '']);
ɵɵtemplate(0, () => {}, 0, 0, 'ng-template', ['tplRef', '']);
directiveWithTplRef = getDirectiveOnNode(0, 0);
}
}, 1, 0, [DirectiveWithTplRef]);
@ -102,16 +102,16 @@ describe('TemplateRef', () => {
function ngIfTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtext(0, 'text');
ɵɵtext(0, 'text');
}
}
function embeddedTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(0, ngIfTemplate, 1, 0, 'ng-template', [AttributeMarker.Bindings, 'ngIf']);
ɵɵtemplate(0, ngIfTemplate, 1, 0, 'ng-template', [AttributeMarker.Bindings, 'ngIf']);
}
if (rf & RenderFlags.Update) {
ΔelementProperty(0, 'ngIf', Δbind(ctx.showing));
ɵɵelementProperty(0, 'ngIf', ɵɵbind(ctx.showing));
}
}
@ -120,7 +120,7 @@ describe('TemplateRef', () => {
*/
const AppComponent = createComponent('app-cmp', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(0, embeddedTemplate, 1, 1, 'ng-template', ['tplRef', '']);
ɵɵtemplate(0, embeddedTemplate, 1, 1, 'ng-template', ['tplRef', '']);
directiveWithTplRef = getDirectiveOnNode(0, 0);
}
}, 1, 0, [DirectiveWithTplRef, NgIf]);
@ -147,9 +147,9 @@ describe('TemplateRef', () => {
function embeddedTemplate(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ΔelementContainerStart(0);
{ Δtext(1, 'text'); }
ΔelementContainerEnd();
ɵɵelementContainerStart(0);
{ ɵɵtext(1, 'text'); }
ɵɵelementContainerEnd();
}
}
@ -158,7 +158,7 @@ describe('TemplateRef', () => {
*/
const AppComponent = createComponent('app-cmp', function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
Δtemplate(0, embeddedTemplate, 2, 0, 'ng-template', ['tplRef', '']);
ɵɵtemplate(0, embeddedTemplate, 2, 0, 'ng-template', ['tplRef', '']);
directiveWithTplRef = getDirectiveOnNode(0, 0);
}
}, 1, 0, [DirectiveWithTplRef]);

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More