refactor(ivy): migrate ɵɵ prefix back to Δ (#30362)
Now that issues are resolved with Closure compiler, we can move back to our desired prefix of `Δ`. PR Close #30362
This commit is contained in:

committed by
Alex Rickabaugh

parent
dbb150a9bd
commit
cf86ed7b29
@ -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()])
|
||||
});
|
||||
|
@ -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()])
|
||||
});
|
||||
|
@ -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';
|
||||
|
@ -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,114 +38,114 @@ 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,
|
||||
ɵɵproperty,
|
||||
ɵɵpropertyInterpolate,
|
||||
ɵɵpropertyInterpolate1,
|
||||
ɵɵpropertyInterpolate2,
|
||||
ɵɵpropertyInterpolate3,
|
||||
ɵɵpropertyInterpolate4,
|
||||
ɵɵpropertyInterpolate5,
|
||||
ɵɵpropertyInterpolate6,
|
||||
ɵɵpropertyInterpolate7,
|
||||
ɵɵpropertyInterpolate8,
|
||||
ɵɵpropertyInterpolateV,
|
||||
ɵɵcomponentHostSyntheticProperty,
|
||||
ɵɵcomponentHostSyntheticListener,
|
||||
ɵɵprojectionDef,
|
||||
ɵɵreference,
|
||||
ɵɵenableBindings,
|
||||
ɵɵdisableBindings,
|
||||
ɵɵallocHostVars,
|
||||
ɵɵelementAttribute,
|
||||
ɵɵelementContainerStart,
|
||||
ɵɵelementContainerEnd,
|
||||
ɵɵstyling,
|
||||
ɵɵstyleMap,
|
||||
ɵɵclassMap,
|
||||
ɵɵstyleProp,
|
||||
ɵɵstylingApply,
|
||||
ɵɵclassProp,
|
||||
ɵɵelementHostAttrs,
|
||||
ΔrestoreView,
|
||||
ΔcontainerRefreshStart,
|
||||
ΔcontainerRefreshEnd,
|
||||
ΔqueryRefresh,
|
||||
ΔviewQuery,
|
||||
ΔstaticViewQuery,
|
||||
ΔstaticContentQuery,
|
||||
ΔloadViewQuery,
|
||||
ΔcontentQuery,
|
||||
ΔloadContentQuery,
|
||||
ΔelementEnd,
|
||||
ΔelementProperty,
|
||||
Δproperty,
|
||||
ΔpropertyInterpolate,
|
||||
ΔpropertyInterpolate1,
|
||||
ΔpropertyInterpolate2,
|
||||
ΔpropertyInterpolate3,
|
||||
ΔpropertyInterpolate4,
|
||||
ΔpropertyInterpolate5,
|
||||
ΔpropertyInterpolate6,
|
||||
ΔpropertyInterpolate7,
|
||||
ΔpropertyInterpolate8,
|
||||
ΔpropertyInterpolateV,
|
||||
ΔcomponentHostSyntheticProperty,
|
||||
ΔcomponentHostSyntheticListener,
|
||||
ΔprojectionDef,
|
||||
Δreference,
|
||||
ΔenableBindings,
|
||||
ΔdisableBindings,
|
||||
ΔallocHostVars,
|
||||
ΔelementAttribute,
|
||||
ΔelementContainerStart,
|
||||
ΔelementContainerEnd,
|
||||
Δstyling,
|
||||
ΔstyleMap,
|
||||
ΔclassMap,
|
||||
ΔstyleProp,
|
||||
ΔstylingApply,
|
||||
ΔclassProp,
|
||||
ΔelementHostAttrs,
|
||||
|
||||
ɵɵ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';
|
||||
|
||||
|
||||
@ -167,18 +167,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 {
|
||||
|
@ -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} from './injector';
|
||||
export {ɵɵinject, inject, INJECTOR} from './injector_compatibility';
|
||||
export {Δinject, inject, INJECTOR} 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';
|
||||
|
@ -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),
|
||||
});
|
||||
|
@ -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,
|
||||
});
|
||||
|
@ -11,8 +11,8 @@ import {stringify} from '../util/stringify';
|
||||
|
||||
import {resolveForwardRef} from './forward_ref';
|
||||
import {InjectionToken} from './injection_token';
|
||||
import {INJECTOR, NG_TEMP_TOKEN_PATH, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE, catchInjectorError, formatError, ɵɵinject} from './injector_compatibility';
|
||||
import {ɵɵdefineInjectable} from './interface/defs';
|
||||
import {INJECTOR, NG_TEMP_TOKEN_PATH, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE, catchInjectorError, formatError, Δ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';
|
||||
@ -88,9 +88,9 @@ export abstract class Injector {
|
||||
}
|
||||
|
||||
/** @nocollapse */
|
||||
static ngInjectableDef = ɵɵdefineInjectable({
|
||||
static ngInjectableDef = ΔdefineInjectable({
|
||||
providedIn: 'any' as any,
|
||||
factory: () => ɵɵinject(INJECTOR),
|
||||
factory: () => Δinject(INJECTOR),
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ import {stringify} from '../util/stringify';
|
||||
import {resolveForwardRef} from './forward_ref';
|
||||
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 {ValueProvider} from './interface/provider';
|
||||
import {Inject, Optional, Self, SkipSelf} from './metadata';
|
||||
@ -107,10 +107,9 @@ export function injectInjectorOnly<T>(
|
||||
* @see inject
|
||||
* @codeGenApi
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
@ -138,7 +137,7 @@ export function ɵɵinject<T>(token: Type<T>| InjectionToken<T>, flags = InjectF
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const inject = ɵɵinject;
|
||||
export const inject = Δinject;
|
||||
|
||||
/**
|
||||
* Injects `root` tokens in limp mode.
|
||||
@ -149,7 +148,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;
|
||||
@ -186,9 +185,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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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, ɵɵdefineInject
|
||||
* 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 {
|
||||
|
@ -14,8 +14,8 @@ import {stringify} from '../util/stringify';
|
||||
import {resolveForwardRef} from './forward_ref';
|
||||
import {InjectionToken} from './injection_token';
|
||||
import {Injector} from './injector';
|
||||
import {INJECTOR, NG_TEMP_TOKEN_PATH, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE, catchInjectorError, injectArgs, setCurrentInjector, ɵɵinject} from './injector_compatibility';
|
||||
import {InjectableType, InjectorType, InjectorTypeWithProviders, getInjectableDef, getInjectorDef, ɵɵInjectableDef} from './interface/defs';
|
||||
import {INJECTOR, NG_TEMP_TOKEN_PATH, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE, catchInjectorError, 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';
|
||||
@ -366,7 +366,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') {
|
||||
@ -423,7 +423,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 {
|
||||
|
@ -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));
|
||||
|
@ -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> = NgModul
|
||||
* 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.
|
||||
*/
|
||||
@ -350,7 +350,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,
|
||||
|
@ -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';
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
# Code Gen API
|
||||
|
||||
### Prefix ɵɵ
|
||||
### 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.
|
||||
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.
|
||||
- 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.
|
||||
|
@ -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()` | ❌ | ❌ | ❌ |
|
||||
|
||||
|
||||
|
||||
|
@ -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(...);
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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
|
||||
|
@ -9,7 +9,7 @@
|
||||
import '../util/ng_dev_mode';
|
||||
|
||||
import {ChangeDetectionStrategy} from '../change_detection/constants';
|
||||
import {NG_INJECTABLE_DEF, ɵɵdefineInjectable} from '../di/interface/defs';
|
||||
import {NG_INJECTABLE_DEF, ΔdefineInjectable} from '../di/interface/defs';
|
||||
import {Mutable, Type} from '../interface/type';
|
||||
import {NgModuleDef} from '../metadata/ng_module';
|
||||
import {SchemaMetadata} from '../metadata/schema';
|
||||
@ -19,7 +19,7 @@ import {stringify} from '../util/stringify';
|
||||
|
||||
import {EMPTY_ARRAY, EMPTY_OBJ} from './empty';
|
||||
import {NG_BASE_DEF, 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';
|
||||
@ -42,7 +42,7 @@ let _renderCompCount = 0;
|
||||
* ```
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵdefineComponent<T>(componentDefinition: {
|
||||
export function ΔdefineComponent<T>(componentDefinition: {
|
||||
/**
|
||||
* Directive type, needed to configure the injector.
|
||||
*/
|
||||
@ -308,7 +308,7 @@ export function ɵɵdefineComponent<T>(componentDefinition: {
|
||||
// be retrieved through the node injector, so this isn't a problem.
|
||||
if (!type.hasOwnProperty(NG_INJECTABLE_DEF)) {
|
||||
(type as any)[NG_INJECTABLE_DEF] =
|
||||
ɵɵdefineInjectable<T>({factory: componentDefinition.factory as() => T});
|
||||
ΔdefineInjectable<T>({factory: componentDefinition.factory as() => T});
|
||||
}
|
||||
}) as never;
|
||||
|
||||
@ -318,7 +318,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);
|
||||
@ -345,7 +345,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;
|
||||
|
||||
@ -393,7 +393,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>[]);
|
||||
|
||||
@ -497,7 +497,7 @@ function invertObject<T>(
|
||||
* # Example
|
||||
* ```ts
|
||||
* class ShouldBeInherited {
|
||||
* static ngBaseDef = ɵɵdefineBase({
|
||||
* static ngBaseDef = ΔdefineBase({
|
||||
* ...
|
||||
* })
|
||||
* }
|
||||
@ -507,7 +507,7 @@ function invertObject<T>(
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵdefineBase<T>(baseDefinition: {
|
||||
export function ΔdefineBase<T>(baseDefinition: {
|
||||
/**
|
||||
* A map of input names.
|
||||
*
|
||||
@ -580,7 +580,7 @@ export function ɵɵdefineBase<T>(baseDefinition: {
|
||||
* Function executed by the parent template to allow children to apply host bindings.
|
||||
*/
|
||||
hostBindings?: HostBindingsFunction<T>;
|
||||
}): ɵɵBaseDef<T> {
|
||||
}): ΔBaseDef<T> {
|
||||
const declaredInputs: {[P in keyof T]: string} = {} as any;
|
||||
return {
|
||||
inputs: invertObject<T>(baseDefinition.inputs as any, declaredInputs),
|
||||
@ -600,7 +600,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({
|
||||
* ...
|
||||
* });
|
||||
* }
|
||||
@ -608,7 +608,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.
|
||||
*/
|
||||
@ -726,7 +726,7 @@ export const ɵɵdefineDirective = ɵɵdefineComponent as any as<T>(directiveDef
|
||||
*
|
||||
* @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,
|
||||
|
||||
@ -765,7 +765,7 @@ export function getPipeDef<T>(type: any): PipeDef<T>|null {
|
||||
return (type as any)[NG_PIPE_DEF] || null;
|
||||
}
|
||||
|
||||
export function getBaseDef<T>(type: any): ɵɵBaseDef<T>|null {
|
||||
export function getBaseDef<T>(type: any): ΔBaseDef<T>|null {
|
||||
return (type as any)[NG_BASE_DEF] || null;
|
||||
}
|
||||
|
||||
|
@ -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) =>
|
||||
/**
|
||||
* @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 {
|
||||
|
@ -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;
|
||||
|
@ -13,7 +13,7 @@ import {ComponentDef, ContentQueriesFunction, DirectiveDef, DirectiveDefFeature,
|
||||
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) {
|
||||
@ -117,7 +117,7 @@ export function ɵɵInheritDefinitionFeature(definition: DirectiveDef<any>| Comp
|
||||
definition.onInit = definition.onInit || superPrototype.ngOnInit;
|
||||
|
||||
if (superPrototype.ngOnChanges) {
|
||||
ɵɵNgOnChangesFeature()(definition);
|
||||
ΔNgOnChangesFeature()(definition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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) => {
|
||||
|
@ -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?: numb
|
||||
*
|
||||
* @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];
|
||||
}
|
||||
|
@ -6,115 +6,115 @@
|
||||
* 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,
|
||||
ɵɵclassMap,
|
||||
ɵɵclassProp,
|
||||
ɵɵcomponentHostSyntheticListener,
|
||||
ɵɵcomponentHostSyntheticProperty,
|
||||
ΔallocHostVars,
|
||||
Δbind,
|
||||
ΔclassMap,
|
||||
ΔclassProp,
|
||||
ΔcomponentHostSyntheticListener,
|
||||
ΔcomponentHostSyntheticProperty,
|
||||
|
||||
ɵɵcontainer,
|
||||
ɵɵcontainerRefreshEnd,
|
||||
ɵɵcontainerRefreshStart,
|
||||
Δcontainer,
|
||||
ΔcontainerRefreshEnd,
|
||||
ΔcontainerRefreshStart,
|
||||
|
||||
ɵɵdirectiveInject,
|
||||
ΔdirectiveInject,
|
||||
|
||||
ɵɵelement,
|
||||
ɵɵelementAttribute,
|
||||
ɵɵelementContainerEnd,
|
||||
Δelement,
|
||||
ΔelementAttribute,
|
||||
ΔelementContainerEnd,
|
||||
|
||||
ɵɵelementContainerStart,
|
||||
ɵɵelementEnd,
|
||||
ΔelementContainerStart,
|
||||
ΔelementEnd,
|
||||
|
||||
ɵɵelementHostAttrs,
|
||||
ɵɵelementProperty,
|
||||
ɵɵelementStart,
|
||||
ɵɵembeddedViewEnd,
|
||||
ΔelementHostAttrs,
|
||||
ΔelementProperty,
|
||||
ΔelementStart,
|
||||
Δ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,
|
||||
ɵɵpropertyInterpolate,
|
||||
ɵɵpropertyInterpolate1,
|
||||
ɵɵpropertyInterpolate2,
|
||||
ɵɵpropertyInterpolate3,
|
||||
ɵɵpropertyInterpolate4,
|
||||
ɵɵpropertyInterpolate5,
|
||||
ɵɵpropertyInterpolate6,
|
||||
ɵɵpropertyInterpolate7,
|
||||
ɵɵpropertyInterpolate8,
|
||||
ɵɵpropertyInterpolateV,
|
||||
Δprojection,
|
||||
ΔprojectionDef,
|
||||
Δproperty,
|
||||
ΔpropertyInterpolate,
|
||||
ΔpropertyInterpolate1,
|
||||
ΔpropertyInterpolate2,
|
||||
ΔpropertyInterpolate3,
|
||||
ΔpropertyInterpolate4,
|
||||
ΔpropertyInterpolate5,
|
||||
ΔpropertyInterpolate6,
|
||||
ΔpropertyInterpolate7,
|
||||
ΔpropertyInterpolate8,
|
||||
ΔpropertyInterpolateV,
|
||||
|
||||
ɵɵreference,
|
||||
Δreference,
|
||||
|
||||
ɵɵselect,
|
||||
ɵɵstyleMap,
|
||||
ɵɵstyleProp,
|
||||
ɵɵstyling,
|
||||
ɵɵstylingApply,
|
||||
ɵɵtemplate,
|
||||
Δselect,
|
||||
ΔstyleMap,
|
||||
ΔstyleProp,
|
||||
Δstyling,
|
||||
ΔstylingApply,
|
||||
Δ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';
|
||||
@ -128,71 +128,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,
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {InjectFlags, InjectionToken, resolveForwardRef} from '../../di';
|
||||
import {ɵɵinject} from '../../di/injector_compatibility';
|
||||
import {Δinject} from '../../di/injector_compatibility';
|
||||
import {Type} from '../../interface/type';
|
||||
import {getOrCreateInjectable, injectAttributeImpl} from '../di';
|
||||
import {TContainerNode, TElementContainerNode, TElementNode} from '../interfaces/node';
|
||||
@ -24,9 +24,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))
|
||||
* });
|
||||
* }
|
||||
* ```
|
||||
@ -36,15 +36,15 @@ 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);
|
||||
const lView = getLView();
|
||||
// Fall back to inject() if view hasn't been created. This situation can happen in tests
|
||||
// if inject utilities are used before bootstrapping.
|
||||
if (lView == null) return ɵɵinject(token, flags);
|
||||
if (lView == null) return Δinject(token, flags);
|
||||
|
||||
return getOrCreateInjectable<T>(
|
||||
getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode, lView,
|
||||
@ -56,6 +56,6 @@ export function ɵɵdirectiveInject<T>(
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵinjectAttribute(attrNameToInject: string): string|null {
|
||||
export function ΔinjectAttribute(attrNameToInject: string): string|null {
|
||||
return injectAttributeImpl(getPreviousOrParentTNode(), attrNameToInject);
|
||||
}
|
||||
|
@ -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);
|
||||
@ -183,10 +183,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();
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +202,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) {
|
||||
@ -270,7 +270,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);
|
||||
|
@ -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];
|
||||
|
@ -26,8 +26,7 @@ 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
|
||||
@ -128,7 +127,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];
|
||||
|
||||
|
@ -17,6 +17,6 @@ import {getLView} from '../state';
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵgetCurrentView(): OpaqueViewState {
|
||||
export function ΔgetCurrentView(): OpaqueViewState {
|
||||
return getLView() as any as OpaqueViewState;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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';
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 =
|
||||
|
@ -35,16 +35,16 @@ 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();
|
||||
ngDevMode && assertNotEqual(index, -1, 'selected index cannot be -1');
|
||||
const bindReconciledValue = ɵɵbind(value);
|
||||
const bindReconciledValue = Δbind(value);
|
||||
if (bindReconciledValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, bindReconciledValue, sanitizer, nativeOnly);
|
||||
}
|
||||
return ɵɵproperty;
|
||||
return Δproperty;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,7 +54,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);
|
||||
@ -79,7 +79,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 {
|
||||
if (value !== NO_CHANGE) {
|
||||
@ -110,7 +110,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) {
|
||||
if (value !== NO_CHANGE) {
|
||||
|
@ -31,7 +31,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;
|
||||
@ -76,7 +76,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);
|
||||
@ -88,7 +88,7 @@ export function ɵɵinterpolation1(prefix: string, v0: any, suffix: string): str
|
||||
*
|
||||
* @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];
|
||||
@ -109,7 +109,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();
|
||||
@ -135,7 +135,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();
|
||||
@ -163,7 +163,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();
|
||||
@ -193,7 +193,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();
|
||||
@ -224,7 +224,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 {
|
||||
@ -258,7 +258,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 {
|
||||
@ -306,7 +306,7 @@ export function ɵɵinterpolation8(
|
||||
* 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,
|
||||
@ -321,10 +321,10 @@ export function ɵɵinterpolation8(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵpropertyInterpolate(
|
||||
export function ΔpropertyInterpolate(
|
||||
propName: string, v0: any, sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
ɵɵpropertyInterpolate1(propName, '', v0, '', sanitizer);
|
||||
return ɵɵpropertyInterpolate;
|
||||
ΔpropertyInterpolate1(propName, '', v0, '', sanitizer);
|
||||
return ΔpropertyInterpolate;
|
||||
}
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@ export function ɵɵpropertyInterpolate(
|
||||
* 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,
|
||||
@ -356,15 +356,15 @@ export function ɵɵpropertyInterpolate(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵpropertyInterpolate1(
|
||||
export function ΔpropertyInterpolate1(
|
||||
propName: string, prefix: string, v0: any, suffix: string,
|
||||
sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue = ɵɵinterpolation1(prefix, v0, suffix);
|
||||
const interpolatedValue = Δinterpolation1(prefix, v0, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate1;
|
||||
return ΔpropertyInterpolate1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -380,7 +380,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,
|
||||
@ -397,15 +397,15 @@ export function ɵɵpropertyInterpolate1(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵpropertyInterpolate2(
|
||||
export function ΔpropertyInterpolate2(
|
||||
propName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string,
|
||||
sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue = ɵɵinterpolation2(prefix, v0, i0, v1, suffix);
|
||||
const interpolatedValue = Δinterpolation2(prefix, v0, i0, v1, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate2;
|
||||
return ΔpropertyInterpolate2;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -421,7 +421,7 @@ export function ɵɵpropertyInterpolate2(
|
||||
* Its compiled representation is::
|
||||
*
|
||||
* ```ts
|
||||
* ɵɵpropertyInterpolate3(
|
||||
* ΔpropertyInterpolate3(
|
||||
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
||||
* ```
|
||||
*
|
||||
@ -441,15 +441,15 @@ export function ɵɵpropertyInterpolate2(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵpropertyInterpolate3(
|
||||
export function ΔpropertyInterpolate3(
|
||||
propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any,
|
||||
suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue = ɵɵinterpolation3(prefix, v0, i0, v1, i1, v2, suffix);
|
||||
const interpolatedValue = Δinterpolation3(prefix, v0, i0, v1, i1, v2, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate3;
|
||||
return ΔpropertyInterpolate3;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -465,7 +465,7 @@ export function ɵɵpropertyInterpolate3(
|
||||
* Its compiled representation is::
|
||||
*
|
||||
* ```ts
|
||||
* ɵɵpropertyInterpolate4(
|
||||
* ΔpropertyInterpolate4(
|
||||
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
||||
* ```
|
||||
*
|
||||
@ -487,15 +487,15 @@ export function ɵɵpropertyInterpolate3(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
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, sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue = ɵɵinterpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
||||
const interpolatedValue = Δinterpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate4;
|
||||
return ΔpropertyInterpolate4;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -511,7 +511,7 @@ export function ɵɵpropertyInterpolate4(
|
||||
* Its compiled representation is::
|
||||
*
|
||||
* ```ts
|
||||
* ɵɵpropertyInterpolate5(
|
||||
* ΔpropertyInterpolate5(
|
||||
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
||||
* ```
|
||||
*
|
||||
@ -535,15 +535,15 @@ export function ɵɵpropertyInterpolate4(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
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, sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue = ɵɵinterpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
||||
const interpolatedValue = Δinterpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate5;
|
||||
return ΔpropertyInterpolate5;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -559,7 +559,7 @@ export function ɵɵpropertyInterpolate5(
|
||||
* Its compiled representation is::
|
||||
*
|
||||
* ```ts
|
||||
* ɵɵpropertyInterpolate6(
|
||||
* ΔpropertyInterpolate6(
|
||||
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
|
||||
* ```
|
||||
*
|
||||
@ -585,17 +585,17 @@ export function ɵɵpropertyInterpolate5(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
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,
|
||||
sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue =
|
||||
ɵɵinterpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
|
||||
Δinterpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate6;
|
||||
return ΔpropertyInterpolate6;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -611,7 +611,7 @@ export function ɵɵpropertyInterpolate6(
|
||||
* Its compiled representation is::
|
||||
*
|
||||
* ```ts
|
||||
* ɵɵpropertyInterpolate7(
|
||||
* ΔpropertyInterpolate7(
|
||||
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
|
||||
* ```
|
||||
*
|
||||
@ -639,17 +639,17 @@ export function ɵɵpropertyInterpolate6(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
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,
|
||||
sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue =
|
||||
ɵɵinterpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
|
||||
Δinterpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate7;
|
||||
return ΔpropertyInterpolate7;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -665,7 +665,7 @@ export function ɵɵpropertyInterpolate7(
|
||||
* Its compiled representation is::
|
||||
*
|
||||
* ```ts
|
||||
* ɵɵpropertyInterpolate8(
|
||||
* ΔpropertyInterpolate8(
|
||||
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
|
||||
* ```
|
||||
*
|
||||
@ -695,17 +695,17 @@ export function ɵɵpropertyInterpolate7(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
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, sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const interpolatedValue =
|
||||
ɵɵinterpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
|
||||
Δinterpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolate8;
|
||||
return ΔpropertyInterpolate8;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -721,7 +721,7 @@ export function ɵɵpropertyInterpolate8(
|
||||
* Its compiled representation is::
|
||||
*
|
||||
* ```ts
|
||||
* ɵɵpropertyInterpolateV(
|
||||
* ΔpropertyInterpolateV(
|
||||
* 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
|
||||
* 'suffix']);
|
||||
* ```
|
||||
@ -738,13 +738,13 @@ export function ɵɵpropertyInterpolate8(
|
||||
* @returns itself, so that it may be chained.
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵpropertyInterpolateV(
|
||||
export function ΔpropertyInterpolateV(
|
||||
propName: string, values: any[], sanitizer?: SanitizerFn): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
|
||||
const interpolatedValue = ɵɵinterpolationV(values);
|
||||
const interpolatedValue = ΔinterpolationV(values);
|
||||
if (interpolatedValue !== NO_CHANGE) {
|
||||
elementPropertyInternal(index, propName, interpolatedValue, sanitizer);
|
||||
}
|
||||
return ɵɵpropertyInterpolateV;
|
||||
return ΔpropertyInterpolateV;
|
||||
}
|
||||
|
@ -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(
|
||||
@ -44,6 +44,6 @@ export function ɵɵselect(index: number): void {
|
||||
// We must set the selected index *after* running the hooks, because hooks may have side-effects
|
||||
// that cause other template functions to run, thus updating the selected index, which is global
|
||||
// state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index
|
||||
// will be altered by the time we leave the `ɵɵselect` instruction.
|
||||
// will be altered by the time we leave the `Δselect` instruction.
|
||||
setSelectedIndex(index);
|
||||
}
|
||||
|
@ -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, getSelectedIndex, incrementActiveDirectiveId, isCreationMode, leaveView, resetComponentState, setActiveHostElement, setBindingRoot, setCheckNoChangesMode, setCurrentDirectiveDef, setCurrentQueryIndex, setIsParent, setPreviousOrParentTNode, setSelectedIndex, ɵɵnamespaceHTML} from '../state';
|
||||
import {enterView, getBindingsEnabled, getCheckNoChangesMode, getIsParent, getLView, getNamespace, getPreviousOrParentTNode, getSelectedIndex, 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';
|
||||
@ -484,7 +484,7 @@ function renderComponentOrTemplate<T>(
|
||||
}
|
||||
|
||||
function executeTemplate<T>(templateFn: ComponentTemplate<T>, rf: RenderFlags, context: T) {
|
||||
ɵɵnamespaceHTML();
|
||||
ΔnamespaceHTML();
|
||||
const prevSelectedIndex = getSelectedIndex();
|
||||
try {
|
||||
setActiveHostElement(null);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ import {scheduleTick, setInputsForProperty} from './shared';
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵstyling(
|
||||
export function Δstyling(
|
||||
classBindingNames?: string[] | null, styleBindingNames?: string[] | null,
|
||||
styleSanitizer?: StyleSanitizeFn | null): void {
|
||||
const tNode = getPreviousOrParentTNode();
|
||||
@ -133,7 +133,7 @@ function initstyling(
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵstyleProp(
|
||||
export function ΔstyleProp(
|
||||
styleIndex: number, value: string | number | String | PlayerFactory | null,
|
||||
suffix?: string | null, forceOverride?: boolean): void {
|
||||
const index = getSelectedIndex();
|
||||
@ -190,7 +190,7 @@ function resolveStylePropValue(
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵclassProp(
|
||||
export function ΔclassProp(
|
||||
classIndex: number, value: boolean | PlayerFactory, forceOverride?: boolean): void {
|
||||
const index = getSelectedIndex();
|
||||
const input = (value instanceof BoundPlayerFactory) ?
|
||||
@ -234,7 +234,7 @@ function booleanOrNull(value: any): boolean|null {
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵstyleMap(styles: {[styleName: string]: any} | NO_CHANGE | null): void {
|
||||
export function ΔstyleMap(styles: {[styleName: string]: any} | NO_CHANGE | null): void {
|
||||
const index = getSelectedIndex();
|
||||
const lView = getLView();
|
||||
const stylingContext = getStylingContext(index, lView);
|
||||
@ -278,7 +278,7 @@ export function ɵɵstyleMap(styles: {[styleName: string]: any} | NO_CHANGE | nu
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵclassMap(classes: {[styleName: string]: any} | NO_CHANGE | string | null): void {
|
||||
export function ΔclassMap(classes: {[styleName: string]: any} | NO_CHANGE | string | null): void {
|
||||
const index = getSelectedIndex();
|
||||
const lView = getLView();
|
||||
const stylingContext = getStylingContext(index, lView);
|
||||
@ -311,7 +311,7 @@ export function ɵɵclassMap(classes: {[styleName: string]: any} | NO_CHANGE | s
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵstylingApply(): void {
|
||||
export function ΔstylingApply(): void {
|
||||
const index = getSelectedIndex();
|
||||
const directiveStylingIndex =
|
||||
getActiveDirectiveStylingIndex() || DEFAULT_TEMPLATE_DIRECTIVE_INDEX;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
@ -156,7 +156,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;
|
||||
|
@ -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,124 +18,124 @@ 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,
|
||||
'ɵɵproperty': r3.ɵɵproperty,
|
||||
'ɵɵpropertyInterpolate': r3.ɵɵpropertyInterpolate,
|
||||
'ɵɵpropertyInterpolate1': r3.ɵɵpropertyInterpolate1,
|
||||
'ɵɵpropertyInterpolate2': r3.ɵɵpropertyInterpolate2,
|
||||
'ɵɵpropertyInterpolate3': r3.ɵɵpropertyInterpolate3,
|
||||
'ɵɵpropertyInterpolate4': r3.ɵɵpropertyInterpolate4,
|
||||
'ɵɵpropertyInterpolate5': r3.ɵɵpropertyInterpolate5,
|
||||
'ɵɵpropertyInterpolate6': r3.ɵɵpropertyInterpolate6,
|
||||
'ɵɵpropertyInterpolate7': r3.ɵɵpropertyInterpolate7,
|
||||
'ɵɵpropertyInterpolate8': r3.ɵɵpropertyInterpolate8,
|
||||
'ɵɵpropertyInterpolateV': r3.ɵɵpropertyInterpolateV,
|
||||
'ɵɵ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,
|
||||
'ɵɵclassMap': r3.ɵɵclassMap,
|
||||
'ɵɵstyling': r3.ɵɵstyling,
|
||||
'ɵɵstyleMap': r3.ɵɵstyleMap,
|
||||
'ɵɵstyleProp': r3.ɵɵstyleProp,
|
||||
'ɵɵstylingApply': r3.ɵɵstylingApply,
|
||||
'ɵɵclassProp': r3.ɵɵclassProp,
|
||||
'ɵɵ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,
|
||||
'Δproperty': r3.Δproperty,
|
||||
'ΔpropertyInterpolate': r3.ΔpropertyInterpolate,
|
||||
'ΔpropertyInterpolate1': r3.ΔpropertyInterpolate1,
|
||||
'ΔpropertyInterpolate2': r3.ΔpropertyInterpolate2,
|
||||
'ΔpropertyInterpolate3': r3.ΔpropertyInterpolate3,
|
||||
'ΔpropertyInterpolate4': r3.ΔpropertyInterpolate4,
|
||||
'ΔpropertyInterpolate5': r3.ΔpropertyInterpolate5,
|
||||
'ΔpropertyInterpolate6': r3.ΔpropertyInterpolate6,
|
||||
'ΔpropertyInterpolate7': r3.ΔpropertyInterpolate7,
|
||||
'ΔpropertyInterpolate8': r3.ΔpropertyInterpolate8,
|
||||
'ΔpropertyInterpolateV': r3.ΔpropertyInterpolateV,
|
||||
'Δ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,
|
||||
'ΔclassMap': r3.ΔclassMap,
|
||||
'Δstyling': r3.Δstyling,
|
||||
'ΔstyleMap': r3.ΔstyleMap,
|
||||
'ΔstyleProp': r3.ΔstyleProp,
|
||||
'ΔstylingApply': r3.ΔstylingApply,
|
||||
'ΔclassProp': r3.ΔclassProp,
|
||||
'Δ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,
|
||||
};
|
||||
|
@ -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,12 +122,11 @@ export function ɵɵpipeBind2(index: number, slotOffset: number, v1: any, v2: an
|
||||
*
|
||||
* @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));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,12 +144,12 @@ export function ɵɵpipeBind3(index: number, slotOffset: number, v1: any, v2: an
|
||||
*
|
||||
* @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));
|
||||
}
|
||||
|
||||
@ -166,10 +165,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));
|
||||
}
|
||||
|
||||
|
@ -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, thisAr
|
||||
*
|
||||
* @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;
|
||||
|
@ -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';
|
||||
@ -391,7 +391,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();
|
||||
|
||||
@ -413,10 +413,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) {
|
||||
@ -434,7 +434,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();
|
||||
@ -454,10 +454,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -472,7 +472,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> {
|
||||
@ -503,11 +503,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) {
|
||||
@ -519,7 +519,7 @@ export function ɵɵstaticContentQuery<T>(
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵloadContentQuery<T>(): QueryList<T> {
|
||||
export function ΔloadContentQuery<T>(): QueryList<T> {
|
||||
const lView = getLView();
|
||||
ngDevMode &&
|
||||
assertDefined(
|
||||
|
@ -83,17 +83,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;
|
||||
}
|
||||
|
||||
@ -106,17 +106,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;
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ export function getActiveDirectiveSuperClassDepth() {
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵrestoreView(viewToRestore: OpaqueViewState) {
|
||||
export function ΔrestoreView(viewToRestore: OpaqueViewState) {
|
||||
contextLView = viewToRestore as any as LView;
|
||||
}
|
||||
|
||||
@ -495,7 +495,7 @@ let _currentNamespace: string|null = null;
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵnamespaceSVG() {
|
||||
export function ΔnamespaceSVG() {
|
||||
_currentNamespace = 'http://www.w3.org/2000/svg';
|
||||
}
|
||||
|
||||
@ -504,7 +504,7 @@ export function ɵɵnamespaceSVG() {
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵnamespaceMathML() {
|
||||
export function ΔnamespaceMathML() {
|
||||
_currentNamespace = 'http://www.w3.org/1998/MathML/';
|
||||
}
|
||||
|
||||
@ -514,7 +514,7 @@ export function ɵɵnamespaceMathML() {
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵnamespaceHTML() {
|
||||
export function ΔnamespaceHTML() {
|
||||
_currentNamespace = null;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,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};
|
||||
}
|
||||
|
||||
@ -64,7 +64,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};
|
||||
}
|
||||
|
||||
@ -72,7 +72,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};
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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:
|
||||
*
|
||||
* @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) {
|
||||
|
@ -9,7 +9,7 @@
|
||||
import {resolveForwardRef} from '../di/forward_ref';
|
||||
import {Injector} from '../di/injector';
|
||||
import {INJECTOR, 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);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
import {DebugElement__PRE_R3__, DebugEventListener, DebugNode__PRE_R3__, 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);
|
||||
|
@ -690,33 +690,33 @@
|
||||
"name": "viewAttachedToChangeDetector"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineComponent"
|
||||
"name": "ΔdefineComponent"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineInjectable"
|
||||
"name": "ΔdefineInjectable"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
@ -501,15 +501,15 @@
|
||||
"name": "viewAttachedToChangeDetector"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineComponent"
|
||||
"name": "ΔdefineComponent"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineInjectable"
|
||||
"name": "ΔdefineInjectable"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵnamespaceHTML"
|
||||
"name": "ΔnamespaceHTML"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵtext"
|
||||
"name": "Δtext"
|
||||
}
|
||||
]
|
@ -195,12 +195,12 @@
|
||||
"name": "throwMixedMultiProviderError"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineInjectable"
|
||||
"name": "ΔdefineInjectable"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineInjector"
|
||||
"name": "ΔdefineInjector"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵinject"
|
||||
"name": "Δinject"
|
||||
}
|
||||
]
|
@ -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],
|
||||
});
|
||||
|
@ -1362,72 +1362,72 @@
|
||||
"name": "wrapListener"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵbind"
|
||||
"name": "Δbind"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵclassProp"
|
||||
"name": "ΔclassProp"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineComponent"
|
||||
"name": "ΔdefineComponent"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineDirective"
|
||||
"name": "ΔdefineDirective"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdefineInjectable"
|
||||
"name": "ΔdefineInjectable"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵdirectiveInject"
|
||||
"name": "ΔdirectiveInject"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵelementEnd"
|
||||
"name": "ΔelementEnd"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵelementStart"
|
||||
"name": "ΔelementStart"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵgetCurrentView"
|
||||
"name": "ΔgetCurrentView"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵinject"
|
||||
"name": "Δinject"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵinterpolation1"
|
||||
"name": "Δinterpolation1"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵlistener"
|
||||
"name": "Δlistener"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵnamespaceHTML"
|
||||
"name": "ΔnamespaceHTML"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵnextContext"
|
||||
"name": "ΔnextContext"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵproperty"
|
||||
"name": "Δproperty"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵreference"
|
||||
"name": "Δreference"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵrestoreView"
|
||||
"name": "ΔrestoreView"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵselect"
|
||||
"name": "Δselect"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵstyling"
|
||||
"name": "Δstyling"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵstylingApply"
|
||||
"name": "ΔstylingApply"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵtemplate"
|
||||
"name": "Δtemplate"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵtext"
|
||||
"name": "Δtext"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵtextBinding"
|
||||
"name": "ΔtextBinding"
|
||||
}
|
||||
]
|
@ -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;
|
||||
|
@ -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: (?).');
|
||||
|
@ -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';
|
||||
@ -1374,7 +1374,7 @@ function declareTests(config?: {useJit: boolean}) {
|
||||
}
|
||||
|
||||
class Bar {
|
||||
static ngInjectableDef: ɵɵInjectableDef<Bar> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<Bar> = ΔdefineInjectable({
|
||||
factory: () => new Bar(),
|
||||
providedIn: SomeModule,
|
||||
});
|
||||
@ -1406,7 +1406,7 @@ function declareTests(config?: {useJit: boolean}) {
|
||||
}
|
||||
|
||||
class Bar {
|
||||
static ngInjectableDef: ɵɵInjectableDef<Bar> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<Bar> = ΔdefineInjectable({
|
||||
factory: () => new Bar(),
|
||||
providedIn: SomeModule,
|
||||
});
|
||||
|
@ -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
|
||||
|
@ -10,8 +10,8 @@ import {withBody} from '@angular/private/testing';
|
||||
|
||||
import {ChangeDetectionStrategy, DoCheck} from '../../src/core';
|
||||
import {whenRendered} from '../../src/render3/component';
|
||||
import {LifecycleHooksFeature, getRenderedText, ɵɵdefineComponent, ɵɵgetCurrentView} from '../../src/render3/index';
|
||||
import {detectChanges, markDirty, tick, ɵɵbind, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵinterpolation1, ɵɵinterpolation2, ɵɵlistener, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
|
||||
import {LifecycleHooksFeature, getRenderedText, ΔdefineComponent, ΔgetCurrentView} from '../../src/render3/index';
|
||||
import {detectChanges, markDirty, tick, Δbind, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, Δinterpolation1, Δinterpolation2, Δlistener, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
import {Renderer3, RendererFactory3} from '../../src/render3/interfaces/renderer';
|
||||
import {FLAGS, LViewFlags} from '../../src/render3/interfaces/view';
|
||||
@ -25,7 +25,7 @@ describe('change detection', () => {
|
||||
doCheckCount = 0;
|
||||
ngDoCheck(): void { this.doCheckCount++; }
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [['my-comp']],
|
||||
factory: () => new MyComponent(),
|
||||
@ -33,12 +33,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));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -100,7 +100,7 @@ describe('change detection', () => {
|
||||
|
||||
onClick() {}
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [['my-comp']],
|
||||
factory: () => comp = new MyComponent(),
|
||||
@ -112,15 +112,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,
|
||||
@ -138,7 +138,7 @@ describe('change detection', () => {
|
||||
|
||||
onClick() {}
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: ManualComponent,
|
||||
selectors: [['manual-comp']],
|
||||
factory: () => comp = new ManualComponent(),
|
||||
@ -152,18 +152,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,
|
||||
@ -174,7 +174,7 @@ describe('change detection', () => {
|
||||
class ManualApp {
|
||||
name: string = 'Nancy';
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: ManualApp,
|
||||
selectors: [['manual-app']],
|
||||
factory: () => new ManualApp(),
|
||||
@ -183,10 +183,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));
|
||||
}
|
||||
|
||||
},
|
||||
@ -229,7 +229,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(),
|
||||
@ -238,11 +238,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],
|
||||
@ -252,7 +252,7 @@ describe('change detection', () => {
|
||||
|
||||
const MyButtonApp = createComponent('my-button-app', function(rf: RenderFlags) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelement(0, 'button-parent');
|
||||
Δelement(0, 'button-parent');
|
||||
}
|
||||
}, 1, 0, [ButtonParent]);
|
||||
|
||||
@ -306,7 +306,7 @@ describe('change detection', () => {
|
||||
return 'works';
|
||||
}
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [['my-comp']],
|
||||
factory: () => new MyComponent(),
|
||||
@ -314,10 +314,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));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -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'}
|
||||
});
|
||||
|
@ -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']],
|
||||
|
@ -6,10 +6,10 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ViewEncapsulation, ɵɵdefineInjectable, ɵɵdefineInjector} from '../../src/core';
|
||||
import {ViewEncapsulation, ΔdefineInjectable, ΔdefineInjector} from '../../src/core';
|
||||
import {createInjector} from '../../src/di/r3_injector';
|
||||
import {AttributeMarker, ComponentFactory, LifecycleHooksFeature, getRenderedText, markDirty, ɵɵ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, Δ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';
|
||||
@ -21,7 +21,7 @@ describe('component', () => {
|
||||
|
||||
increment() { this.count++; }
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: CounterComponent,
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
selectors: [['counter']],
|
||||
@ -29,10 +29,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,
|
||||
@ -64,30 +64,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')}]
|
||||
});
|
||||
@ -112,7 +112,7 @@ describe('component', () => {
|
||||
// @Input
|
||||
name = '';
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: Comp,
|
||||
selectors: [['comp']],
|
||||
factory: () => new Comp(),
|
||||
@ -120,10 +120,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'}
|
||||
@ -134,10 +134,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]);
|
||||
|
||||
@ -156,16 +156,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,
|
||||
@ -181,14 +181,13 @@ 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));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -214,32 +213,32 @@ it('should not invoke renderer destroy method for embedded views', () => {
|
||||
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']],
|
||||
@ -247,16 +246,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,
|
||||
@ -266,10 +265,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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,7 +315,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']],
|
||||
@ -325,40 +324,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'}
|
||||
@ -380,7 +379,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']],
|
||||
@ -390,18 +389,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));
|
||||
}
|
||||
|
||||
},
|
||||
@ -411,23 +410,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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -460,19 +459,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]);
|
||||
|
||||
@ -494,19 +493,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]);
|
||||
|
||||
@ -525,7 +524,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']],
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -10,9 +10,9 @@ import {ChangeDetectorRef, Host, InjectFlags, Injector, Optional, Renderer2, Sel
|
||||
import {createLView, createNodeAtIndex, createTView} from '@angular/core/src/render3/instructions/shared';
|
||||
import {RenderFlags} from '@angular/core/src/render3/interfaces/definition';
|
||||
|
||||
import {ɵɵdefineComponent} from '../../src/render3/definition';
|
||||
import {ΔdefineComponent} from '../../src/render3/definition';
|
||||
import {bloomAdd, bloomHasToken, bloomHashBitOrFactory as bloomHash, getOrCreateNodeInjectorForNode} from '../../src/render3/di';
|
||||
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdefineDirective, ɵɵdirectiveInject, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation2, ɵɵprojection, ɵɵprojectionDef, ɵɵreference, ɵɵtext, ɵɵtextBinding} from '../../src/render3/index';
|
||||
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdefineDirective, ΔdirectiveInject, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation2, Δprojection, ΔprojectionDef, Δreference, Δtext, ΔtextBinding} from '../../src/render3/index';
|
||||
import {TNODE} from '../../src/render3/interfaces/injector';
|
||||
import {TNodeType} from '../../src/render3/interfaces/node';
|
||||
import {isProceduralRenderer} from '../../src/render3/interfaces/renderer';
|
||||
@ -31,7 +31,7 @@ describe('di', () => {
|
||||
value = 'DirB';
|
||||
constructor() { log.push(this.value); }
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
selectors: [['', 'dirB', '']],
|
||||
type: DirB,
|
||||
factory: () => new DirB(),
|
||||
@ -49,10 +49,10 @@ describe('di', () => {
|
||||
class DirA {
|
||||
constructor(dir: DirB) { log.push(`DirA (dep: ${dir.value})`); }
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
selectors: [['', 'dirA', '']],
|
||||
type: DirA,
|
||||
factory: () => new DirA(ɵɵdirectiveInject(DirB))
|
||||
factory: () => new DirA(ΔdirectiveInject(DirB))
|
||||
});
|
||||
}
|
||||
|
||||
@ -63,19 +63,19 @@ describe('di', () => {
|
||||
*/
|
||||
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 < 3; i++) {
|
||||
if (ɵɵembeddedViewStart(0, 1, 0)) {
|
||||
ɵɵelement(0, 'div', ['dirA', '', 'dirB', '']);
|
||||
if (ΔembeddedViewStart(0, 1, 0)) {
|
||||
Δelement(0, 'div', ['dirA', '', 'dirB', '']);
|
||||
}
|
||||
ɵɵembeddedViewEnd();
|
||||
ΔembeddedViewEnd();
|
||||
}
|
||||
}
|
||||
ɵɵcontainerRefreshEnd();
|
||||
ΔcontainerRefreshEnd();
|
||||
}
|
||||
}, 1, 0, [DirA, DirB]);
|
||||
|
||||
@ -92,11 +92,11 @@ describe('di', () => {
|
||||
this.injector = vcr.injector;
|
||||
}
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: DirA,
|
||||
selectors: [['', 'dirA', '']],
|
||||
factory:
|
||||
() => new DirA(ɵɵdirectiveInject(DirB), ɵɵdirectiveInject(ViewContainerRef as any)),
|
||||
factory: () =>
|
||||
new DirA(ΔdirectiveInject(DirB), ΔdirectiveInject(ViewContainerRef as any)),
|
||||
exportAs: ['dirA']
|
||||
});
|
||||
}
|
||||
@ -117,45 +117,45 @@ describe('di', () => {
|
||||
*/
|
||||
const App = createComponent('app', (rf: RenderFlags, ctx: any) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div', ['dirB', '']);
|
||||
{ ɵɵcontainer(1); }
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', ['dirB', '']);
|
||||
{ Δcontainer(1); }
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵcontainerRefreshStart(1);
|
||||
ΔcontainerRefreshStart(1);
|
||||
{
|
||||
if (!ctx.skipContent) {
|
||||
let rf1 = ɵɵembeddedViewStart(0, 1, 0);
|
||||
let rf1 = ΔembeddedViewStart(0, 1, 0);
|
||||
{
|
||||
if (rf1 & RenderFlags.Create) {
|
||||
ɵɵcontainer(0);
|
||||
Δcontainer(0);
|
||||
}
|
||||
if (rf1 & RenderFlags.Update) {
|
||||
ɵɵcontainerRefreshStart(0);
|
||||
ΔcontainerRefreshStart(0);
|
||||
{
|
||||
if (!ctx.skipContent2) {
|
||||
let rf2 = ɵɵembeddedViewStart(0, 3, 1);
|
||||
let rf2 = ΔembeddedViewStart(0, 3, 1);
|
||||
{
|
||||
if (rf2 & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div', ['dirA', ''], ['dir', 'dirA']);
|
||||
{ ɵɵtext(2); }
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', ['dirA', ''], ['dir', 'dirA']);
|
||||
{ Δtext(2); }
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf2 & RenderFlags.Update) {
|
||||
const dir = ɵɵreference(1) as DirA;
|
||||
ɵɵtextBinding(2, ɵɵbind(dir.dirB.value));
|
||||
const dir = Δreference(1) as DirA;
|
||||
ΔtextBinding(2, Δbind(dir.dirB.value));
|
||||
}
|
||||
}
|
||||
ɵɵembeddedViewEnd();
|
||||
ΔembeddedViewEnd();
|
||||
}
|
||||
}
|
||||
ɵɵcontainerRefreshEnd();
|
||||
ΔcontainerRefreshEnd();
|
||||
}
|
||||
}
|
||||
ɵɵembeddedViewEnd();
|
||||
ΔembeddedViewEnd();
|
||||
}
|
||||
}
|
||||
ɵɵcontainerRefreshEnd();
|
||||
ΔcontainerRefreshEnd();
|
||||
}
|
||||
}, 2, 0, [DirA, DirB]);
|
||||
|
||||
@ -170,7 +170,7 @@ describe('di', () => {
|
||||
// TODO(issue/24571): remove '!'.
|
||||
value !: string;
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: DirB,
|
||||
selectors: [['', 'dirB', '']],
|
||||
factory: () => new DirB(),
|
||||
@ -184,10 +184,10 @@ describe('di', () => {
|
||||
class DirA {
|
||||
constructor(@Optional() public dirB: DirB|null) {}
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: DirA,
|
||||
selectors: [['', 'dirA', '']],
|
||||
factory: () => dirA = new DirA(ɵɵdirectiveInject(DirB, InjectFlags.Optional))
|
||||
factory: () => dirA = new DirA(ΔdirectiveInject(DirB, InjectFlags.Optional))
|
||||
});
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ describe('di', () => {
|
||||
/** <div dirA></div> */
|
||||
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelement(0, 'div', ['dirA', '']);
|
||||
Δelement(0, 'div', ['dirA', '']);
|
||||
}
|
||||
}, 1, 0, [DirA, DirB]);
|
||||
|
||||
@ -213,10 +213,10 @@ describe('di', () => {
|
||||
class DirA {
|
||||
constructor(@Self() public dirB: DirB) {}
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: DirA,
|
||||
selectors: [['', 'dirA', '']],
|
||||
factory: () => dirA = new DirA(ɵɵdirectiveInject(DirB, InjectFlags.Self))
|
||||
factory: () => dirA = new DirA(ΔdirectiveInject(DirB, InjectFlags.Self))
|
||||
});
|
||||
}
|
||||
|
||||
@ -229,9 +229,9 @@ describe('di', () => {
|
||||
*/
|
||||
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div', ['dirB', '']);
|
||||
ɵɵelement(1, 'div', ['dirA', '', 'dirC', '']);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', ['dirB', '']);
|
||||
Δelement(1, 'div', ['dirA', '', 'dirC', '']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
}, 2, 0, [DirA, DirB, DirC]);
|
||||
|
||||
@ -250,10 +250,10 @@ describe('di', () => {
|
||||
class DirA {
|
||||
constructor(@Host() public dirB: DirB) {}
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: DirA,
|
||||
selectors: [['', 'dirA', '']],
|
||||
factory: () => dirA = new DirA(ɵɵdirectiveInject(DirB, InjectFlags.Host))
|
||||
factory: () => dirA = new DirA(ΔdirectiveInject(DirB, InjectFlags.Host))
|
||||
});
|
||||
}
|
||||
|
||||
@ -271,27 +271,27 @@ describe('di', () => {
|
||||
*/
|
||||
const Comp = createComponent('comp', function(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, 1, 0);
|
||||
let rf1 = ΔembeddedViewStart(0, 1, 0);
|
||||
if (rf1 & RenderFlags.Create) {
|
||||
ɵɵelement(0, 'div', ['dirA', '']);
|
||||
Δelement(0, 'div', ['dirA', '']);
|
||||
}
|
||||
ɵɵembeddedViewEnd();
|
||||
ΔembeddedViewEnd();
|
||||
}
|
||||
}
|
||||
ɵɵcontainerRefreshEnd();
|
||||
ΔcontainerRefreshEnd();
|
||||
}
|
||||
}, 1, 0, [DirA, DirB]);
|
||||
|
||||
/* <comp dirB></comp> */
|
||||
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelement(0, 'comp', ['dirB', '']);
|
||||
Δelement(0, 'comp', ['dirB', '']);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
comp = getDirectiveOnNode(0);
|
||||
@ -318,16 +318,16 @@ describe('di', () => {
|
||||
class MyComp {
|
||||
constructor(public cdr: ChangeDetectorRef) {}
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: MyComp,
|
||||
selectors: [['my-comp']],
|
||||
factory: () => comp = new MyComp(ɵɵdirectiveInject(ChangeDetectorRef as any)),
|
||||
factory: () => comp = new MyComp(ΔdirectiveInject(ChangeDetectorRef as any)),
|
||||
consts: 1,
|
||||
vars: 0,
|
||||
template: function(rf: RenderFlags, ctx: MyComp) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵprojectionDef();
|
||||
ɵɵprojection(0);
|
||||
ΔprojectionDef();
|
||||
Δprojection(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -338,10 +338,10 @@ describe('di', () => {
|
||||
|
||||
constructor(public cdr: ChangeDetectorRef) { this.value = (cdr.constructor as any).name; }
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: Directive,
|
||||
selectors: [['', 'dir', '']],
|
||||
factory: () => dir = new Directive(ɵɵdirectiveInject(ChangeDetectorRef as any)),
|
||||
factory: () => dir = new Directive(ΔdirectiveInject(ChangeDetectorRef as any)),
|
||||
exportAs: ['dir']
|
||||
});
|
||||
}
|
||||
@ -349,11 +349,11 @@ describe('di', () => {
|
||||
class DirectiveSameInstance {
|
||||
constructor(public cdr: ChangeDetectorRef) {}
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: DirectiveSameInstance,
|
||||
selectors: [['', 'dirSame', '']],
|
||||
factory: () => dirSameInstance =
|
||||
new DirectiveSameInstance(ɵɵdirectiveInject(ChangeDetectorRef as any))
|
||||
new DirectiveSameInstance(ΔdirectiveInject(ChangeDetectorRef as any))
|
||||
});
|
||||
}
|
||||
|
||||
@ -370,10 +370,10 @@ describe('di', () => {
|
||||
|
||||
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,
|
||||
/**
|
||||
@ -383,26 +383,26 @@ describe('di', () => {
|
||||
*/
|
||||
template: function(rf: RenderFlags, ctx: MyApp) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵcontainer(0);
|
||||
Δcontainer(0);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵcontainerRefreshStart(0);
|
||||
ΔcontainerRefreshStart(0);
|
||||
{
|
||||
if (ctx.showing) {
|
||||
let rf1 = ɵɵembeddedViewStart(0, 3, 1);
|
||||
let rf1 = ΔembeddedViewStart(0, 3, 1);
|
||||
if (rf1 & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div', ['dir', '', 'dirSame', ''], ['dir', 'dir']);
|
||||
{ ɵɵtext(2); }
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', ['dir', '', 'dirSame', ''], ['dir', 'dir']);
|
||||
{ Δtext(2); }
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf1 & RenderFlags.Update) {
|
||||
const tmp = ɵɵreference(1) as any;
|
||||
ɵɵtextBinding(2, ɵɵbind(tmp.value));
|
||||
const tmp = Δreference(1) as any;
|
||||
ΔtextBinding(2, Δbind(tmp.value));
|
||||
}
|
||||
}
|
||||
ɵɵembeddedViewEnd();
|
||||
ΔembeddedViewEnd();
|
||||
}
|
||||
ɵɵcontainerRefreshEnd();
|
||||
ΔcontainerRefreshEnd();
|
||||
}
|
||||
},
|
||||
directives: directives
|
||||
@ -424,15 +424,15 @@ describe('di', () => {
|
||||
class MyComp {
|
||||
constructor(public renderer: Renderer2) {}
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: MyComp,
|
||||
selectors: [['my-comp']],
|
||||
factory: () => new MyComp(ɵɵdirectiveInject(Renderer2 as any)),
|
||||
factory: () => new MyComp(ΔdirectiveInject(Renderer2 as any)),
|
||||
consts: 1,
|
||||
vars: 0,
|
||||
template: function(rf: RenderFlags, ctx: MyComp) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵtext(0, 'Foo');
|
||||
Δtext(0, 'Foo');
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -448,7 +448,7 @@ describe('di', () => {
|
||||
() => { expect(() => new ComponentFixture(MyComp)).toThrow(); });
|
||||
});
|
||||
|
||||
describe('ɵɵinject', () => {
|
||||
describe('Δinject', () => {
|
||||
describe('bloom filter', () => {
|
||||
let mockTView: any;
|
||||
beforeEach(() => {
|
||||
@ -535,10 +535,10 @@ describe('di', () => {
|
||||
class ChildDirective {
|
||||
value: string;
|
||||
constructor(public parent: any) { this.value = (parent.constructor as any).name; }
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: ChildDirective,
|
||||
selectors: [['', 'childDir', '']],
|
||||
factory: () => new ChildDirective(ɵɵdirectiveInject(ParentDirective)),
|
||||
factory: () => new ChildDirective(ΔdirectiveInject(ParentDirective)),
|
||||
exportAs: ['childDir']
|
||||
});
|
||||
}
|
||||
@ -546,11 +546,11 @@ describe('di', () => {
|
||||
class Child2Directive {
|
||||
value: boolean;
|
||||
constructor(parent: any, child: ChildDirective) { this.value = parent === child.parent; }
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
selectors: [['', 'child2Dir', '']],
|
||||
type: Child2Directive,
|
||||
factory: () => new Child2Directive(
|
||||
ɵɵdirectiveInject(ParentDirective), ɵɵdirectiveInject(ChildDirective)),
|
||||
ΔdirectiveInject(ParentDirective), ΔdirectiveInject(ChildDirective)),
|
||||
exportAs: ['child2Dir']
|
||||
});
|
||||
}
|
||||
@ -566,29 +566,29 @@ describe('di', () => {
|
||||
*/
|
||||
const App = createComponent('app', function(rf: RenderFlags, ctx: any) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div', ['parentDir', '']);
|
||||
{ ɵɵcontainer(1); }
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', ['parentDir', '']);
|
||||
{ Δcontainer(1); }
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵcontainerRefreshStart(1);
|
||||
ΔcontainerRefreshStart(1);
|
||||
{
|
||||
let rf1 = ɵɵembeddedViewStart(0, 4, 2);
|
||||
let rf1 = ΔembeddedViewStart(0, 4, 2);
|
||||
if (rf1 & RenderFlags.Create) {
|
||||
ɵɵelementStart(
|
||||
ΔelementStart(
|
||||
0, 'span', ['childDir', '', 'child2Dir', ''],
|
||||
['child1', 'childDir', 'child2', 'child2Dir']);
|
||||
{ ɵɵtext(3); }
|
||||
ɵɵelementEnd();
|
||||
{ Δtext(3); }
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
const tmp1 = ɵɵreference(1) as any;
|
||||
const tmp2 = ɵɵreference(2) as any;
|
||||
ɵɵtextBinding(3, ɵɵinterpolation2('', tmp1.value, '-', tmp2.value, ''));
|
||||
const tmp1 = Δreference(1) as any;
|
||||
const tmp2 = Δreference(2) as any;
|
||||
ΔtextBinding(3, Δinterpolation2('', tmp1.value, '-', tmp2.value, ''));
|
||||
}
|
||||
ɵɵembeddedViewEnd();
|
||||
ΔembeddedViewEnd();
|
||||
}
|
||||
ɵɵcontainerRefreshEnd();
|
||||
ΔcontainerRefreshEnd();
|
||||
}
|
||||
}, 2, 0, [ChildDirective, Child2Directive, ParentDirective]);
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵreference, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
|
||||
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δreference, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
|
||||
import {ComponentFixture, createComponent} from './render_util';
|
||||
@ -23,29 +23,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);
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
*/
|
||||
|
||||
import {noop} from '../../../compiler/src/render3/view/util';
|
||||
import {getTranslationForTemplate, ɵɵi18nAttributes, ɵɵi18nPostprocess, ɵɵi18nStart} from '../../src/render3/i18n';
|
||||
import {ɵɵelementEnd, ɵɵelementStart} from '../../src/render3/instructions/all';
|
||||
import {getTranslationForTemplate, Δi18nAttributes, Δi18nPostprocess, Δi18nStart} from '../../src/render3/i18n';
|
||||
import {ΔelementEnd, ΔelementStart} from '../../src/render3/instructions/all';
|
||||
import {COMMENT_MARKER, ELEMENT_MARKER, I18nMutateOpCode, I18nUpdateOpCode, I18nUpdateOpCodes, TI18n} from '../../src/render3/interfaces/i18n';
|
||||
import {HEADER_OFFSET, LView, TVIEW} from '../../src/render3/interfaces/view';
|
||||
import {getNativeByIndex} from '../../src/render3/util/view_utils';
|
||||
@ -68,7 +68,7 @@ describe('Runtime i18n', () => {
|
||||
const MSG_DIV = `simple text`;
|
||||
const nbConsts = 1;
|
||||
const index = 0;
|
||||
const opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
|
||||
// Check debug
|
||||
const debugOps = (opCodes as any).create.debug !.operations;
|
||||
@ -99,7 +99,7 @@ describe('Runtime i18n', () => {
|
||||
const index = 1;
|
||||
const elementIndex = 2;
|
||||
const elementIndex2 = 3;
|
||||
const opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual({
|
||||
vars: 5,
|
||||
@ -135,7 +135,7 @@ describe('Runtime i18n', () => {
|
||||
const MSG_DIV = `Hello <20>0<EFBFBD>!`;
|
||||
const nbConsts = 2;
|
||||
const index = 1;
|
||||
const opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
|
||||
expect((opCodes as any).update.debug.operations).toEqual([
|
||||
{__raw_opCode: 8, checkBit: 1, type: 'Text', nodeIndex: 2, text: 'Hello <20>0<EFBFBD>!'}
|
||||
@ -160,7 +160,7 @@ describe('Runtime i18n', () => {
|
||||
const MSG_DIV = `Hello <20>0<EFBFBD> and <20>1<EFBFBD>, again <20>0<EFBFBD>!`;
|
||||
const nbConsts = 2;
|
||||
const index = 1;
|
||||
const opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual({
|
||||
vars: 1,
|
||||
@ -193,7 +193,7 @@ describe('Runtime i18n', () => {
|
||||
let nbConsts = 3;
|
||||
let index = 1;
|
||||
const firstTextNode = 3;
|
||||
let opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
let opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual({
|
||||
vars: 2,
|
||||
@ -223,7 +223,7 @@ describe('Runtime i18n', () => {
|
||||
index = 0;
|
||||
const spanElement = 1;
|
||||
const bElementSubTemplate = 2;
|
||||
opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV, 1); }, null, nbConsts, index);
|
||||
opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV, 1); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual({
|
||||
vars: 2,
|
||||
@ -250,7 +250,7 @@ describe('Runtime i18n', () => {
|
||||
nbConsts = 2;
|
||||
index = 0;
|
||||
const bElement = 1;
|
||||
opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV, 2); }, null, nbConsts, index);
|
||||
opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV, 2); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual({
|
||||
vars: 1,
|
||||
@ -275,7 +275,7 @@ describe('Runtime i18n', () => {
|
||||
}`;
|
||||
const nbConsts = 1;
|
||||
const index = 0;
|
||||
const opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const tIcuIndex = 0;
|
||||
const icuCommentNodeIndex = index + 1;
|
||||
const firstTextNodeIndex = index + 2;
|
||||
@ -463,7 +463,7 @@ describe('Runtime i18n', () => {
|
||||
}`;
|
||||
const nbConsts = 1;
|
||||
const index = 0;
|
||||
const opCodes = getOpCodes(() => { ɵɵi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const opCodes = getOpCodes(() => { Δi18nStart(index, MSG_DIV); }, null, nbConsts, index);
|
||||
const icuCommentNodeIndex = index + 1;
|
||||
const firstTextNodeIndex = index + 2;
|
||||
const nestedIcuCommentNodeIndex = index + 3;
|
||||
@ -579,9 +579,9 @@ describe('Runtime i18n', () => {
|
||||
const nbConsts = 2;
|
||||
const index = 1;
|
||||
const fixture = prepareFixture(() => {
|
||||
ɵɵelementStart(0, 'div');
|
||||
ɵɵi18nAttributes(index, MSG_div_attr);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div');
|
||||
Δi18nAttributes(index, MSG_div_attr);
|
||||
ΔelementEnd();
|
||||
}, null, nbConsts, index);
|
||||
const tView = fixture.hostView[TVIEW];
|
||||
const opCodes = tView.data[index + HEADER_OFFSET] as I18nUpdateOpCodes;
|
||||
@ -598,7 +598,7 @@ describe('Runtime i18n', () => {
|
||||
const nbConsts = 2;
|
||||
const index = 1;
|
||||
const opCodes =
|
||||
getOpCodes(() => { ɵɵi18nAttributes(index, MSG_div_attr); }, null, nbConsts, index);
|
||||
getOpCodes(() => { Δi18nAttributes(index, MSG_div_attr); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual([
|
||||
0b1, // bindings mask
|
||||
@ -615,7 +615,7 @@ describe('Runtime i18n', () => {
|
||||
const nbConsts = 2;
|
||||
const index = 1;
|
||||
const opCodes =
|
||||
getOpCodes(() => { ɵɵi18nAttributes(index, MSG_div_attr); }, null, nbConsts, index);
|
||||
getOpCodes(() => { Δi18nAttributes(index, MSG_div_attr); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual([
|
||||
0b11, // bindings mask
|
||||
@ -631,7 +631,7 @@ describe('Runtime i18n', () => {
|
||||
const nbConsts = 2;
|
||||
const index = 1;
|
||||
const opCodes =
|
||||
getOpCodes(() => { ɵɵi18nAttributes(index, MSG_div_attr); }, null, nbConsts, index);
|
||||
getOpCodes(() => { Δi18nAttributes(index, MSG_div_attr); }, null, nbConsts, index);
|
||||
|
||||
expect(opCodes).toEqual([
|
||||
0b1, // bindings mask
|
||||
@ -724,7 +724,7 @@ describe('Runtime i18n', () => {
|
||||
],
|
||||
];
|
||||
cases.forEach(([input, replacements, output]) => {
|
||||
expect(ɵɵi18nPostprocess(input as string, replacements as any)).toEqual(output as string);
|
||||
expect(Δi18nPostprocess(input as string, replacements as any)).toEqual(output as string);
|
||||
});
|
||||
});
|
||||
|
||||
@ -776,7 +776,7 @@ describe('Runtime i18n', () => {
|
||||
<20>/*3:1<>
|
||||
<20>#4<> Bonjour - 5 <20>/#4<>
|
||||
`;
|
||||
expect(ɵɵi18nPostprocess(generated.replace(/\s+/g, ''))).toEqual(final.replace(/\s+/g, ''));
|
||||
expect(Δi18nPostprocess(generated.replace(/\s+/g, ''))).toEqual(final.replace(/\s+/g, ''));
|
||||
});
|
||||
|
||||
it('should throw in case we have invalid string', () => {
|
||||
@ -794,7 +794,7 @@ describe('Runtime i18n', () => {
|
||||
['My ICU #1: <20>I18N_EXP_ICU<43>, My ICU #2: <20>I18N_EXP_ICU<43>', {ICU: ['ICU_VALUE_1']}]
|
||||
];
|
||||
cases.forEach(([input, replacements, output]) => {
|
||||
expect(() => ɵɵi18nPostprocess(input as string, replacements as any)).toThrowError();
|
||||
expect(() => Δi18nPostprocess(input as string, replacements as any)).toThrowError();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -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');
|
||||
});
|
||||
|
@ -8,11 +8,11 @@
|
||||
|
||||
import {NgForOfContext} from '@angular/common';
|
||||
|
||||
import {ɵɵdefineComponent} from '../../src/render3/definition';
|
||||
import {RenderFlags, ɵɵbind, ɵɵclassMap, ɵɵelement, ɵɵelementAttribute, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵinterpolation1, ɵɵproperty, ɵɵselect, ɵɵstyleMap, ɵɵstyleProp, ɵɵstyling, ɵɵstylingApply, ɵɵtemplate, ɵɵtext, ɵɵtextBinding} from '../../src/render3/index';
|
||||
import {ΔdefineComponent} from '../../src/render3/definition';
|
||||
import {RenderFlags, Δbind, ΔclassMap, Δelement, ΔelementAttribute, ΔelementEnd, ΔelementProperty, ΔelementStart, Δinterpolation1, Δproperty, Δselect, ΔstyleMap, ΔstyleProp, Δstyling, ΔstylingApply, Δtemplate, Δtext, ΔtextBinding} from '../../src/render3/index';
|
||||
import {AttributeMarker} from '../../src/render3/interfaces/node';
|
||||
import {bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl} from '../../src/sanitization/bypass';
|
||||
import {ɵɵdefaultStyleSanitizer, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl} from '../../src/sanitization/sanitization';
|
||||
import {ΔdefaultStyleSanitizer, ΔsanitizeHtml, ΔsanitizeResourceUrl, ΔsanitizeScript, ΔsanitizeStyle, ΔsanitizeUrl} from '../../src/sanitization/sanitization';
|
||||
import {Sanitizer, SecurityContext} from '../../src/sanitization/security';
|
||||
import {StyleSanitizeFn} from '../../src/sanitization/style_sanitizer';
|
||||
|
||||
@ -21,9 +21,9 @@ import {ComponentFixture, TemplateFixture} from './render_util';
|
||||
|
||||
describe('instructions', () => {
|
||||
function createAnchor() {
|
||||
ɵɵelementStart(0, 'a');
|
||||
ɵɵstyling();
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'a');
|
||||
Δstyling();
|
||||
ΔelementEnd();
|
||||
}
|
||||
|
||||
function createDiv(
|
||||
@ -37,20 +37,20 @@ describe('instructions', () => {
|
||||
if (initialStyles) {
|
||||
attrs.push(AttributeMarker.Styles, ...initialStyles);
|
||||
}
|
||||
ɵɵelementStart(0, 'div', attrs);
|
||||
ɵɵstyling(classBindingNames || null, styleBindingNames || null, styleSanitizer);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', attrs);
|
||||
Δstyling(classBindingNames || null, styleBindingNames || null, styleSanitizer);
|
||||
ΔelementEnd();
|
||||
}
|
||||
|
||||
function createScript() { ɵɵelement(0, 'script'); }
|
||||
function createScript() { Δelement(0, 'script'); }
|
||||
|
||||
describe('ɵɵselect', () => {
|
||||
describe('Δselect', () => {
|
||||
it('should error in DevMode if index is out of range', () => {
|
||||
// Only one constant added, meaning only index `0` is valid.
|
||||
const t = new TemplateFixture(createDiv, () => {}, 1, 0);
|
||||
expect(() => { t.update(() => { ɵɵselect(-1); }); }).toThrow();
|
||||
expect(() => { t.update(() => { ɵɵselect(1); }); }).toThrow();
|
||||
expect(() => { t.update(() => { ɵɵselect(0); }); }).not.toThrow();
|
||||
expect(() => { t.update(() => { Δselect(-1); }); }).toThrow();
|
||||
expect(() => { t.update(() => { Δselect(1); }); }).toThrow();
|
||||
expect(() => { t.update(() => { Δselect(0); }); }).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@ -58,10 +58,10 @@ describe('instructions', () => {
|
||||
it('should update bindings when value changes with the correct perf counters', () => {
|
||||
const t = new TemplateFixture(createAnchor, () => {}, 1, 1);
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'title', ɵɵbind('Hello')));
|
||||
t.update(() => ΔelementProperty(0, 'title', Δbind('Hello')));
|
||||
expect(t.html).toEqual('<a title="Hello"></a>');
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'title', ɵɵbind('World')));
|
||||
t.update(() => ΔelementProperty(0, 'title', Δbind('World')));
|
||||
expect(t.html).toEqual('<a title="World"></a>');
|
||||
expect(ngDevMode).toHaveProperties({
|
||||
firstTemplatePass: 1,
|
||||
@ -74,7 +74,7 @@ describe('instructions', () => {
|
||||
|
||||
it('should not update bindings when value does not change, with the correct perf counters',
|
||||
() => {
|
||||
const idempotentUpdate = () => ɵɵelementProperty(0, 'title', ɵɵbind('Hello'));
|
||||
const idempotentUpdate = () => ΔelementProperty(0, 'title', Δbind('Hello'));
|
||||
const t = new TemplateFixture(createAnchor, idempotentUpdate, 1, 1);
|
||||
|
||||
t.update();
|
||||
@ -95,7 +95,7 @@ describe('instructions', () => {
|
||||
describe('element', () => {
|
||||
it('should create an element with the correct perf counters', () => {
|
||||
const t = new TemplateFixture(() => {
|
||||
ɵɵelement(0, 'div', ['id', 'test', 'title', 'Hello']);
|
||||
Δelement(0, 'div', ['id', 'test', 'title', 'Hello']);
|
||||
}, () => {}, 1);
|
||||
|
||||
const div = (t.hostElement as HTMLElement).querySelector('div') !;
|
||||
@ -114,12 +114,12 @@ describe('instructions', () => {
|
||||
it('should use sanitizer function', () => {
|
||||
const t = new TemplateFixture(createDiv, () => {}, 1);
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'title', 'javascript:true', ɵɵsanitizeUrl));
|
||||
t.update(() => ΔelementAttribute(0, 'title', 'javascript:true', ΔsanitizeUrl));
|
||||
expect(t.html).toEqual('<div title="unsafe:javascript:true"></div>');
|
||||
|
||||
t.update(
|
||||
() => ɵɵelementAttribute(
|
||||
0, 'title', bypassSanitizationTrustUrl('javascript:true'), ɵɵsanitizeUrl));
|
||||
() => ΔelementAttribute(
|
||||
0, 'title', bypassSanitizationTrustUrl('javascript:true'), ΔsanitizeUrl));
|
||||
expect(t.html).toEqual('<div title="javascript:true"></div>');
|
||||
expect(ngDevMode).toHaveProperties({
|
||||
firstTemplatePass: 1,
|
||||
@ -141,13 +141,13 @@ describe('instructions', () => {
|
||||
// <div [title]="title" [accesskey]="key"></div>
|
||||
const t = new TemplateFixture(createDiv, () => {}, 1, 2);
|
||||
t.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('title', 'one')('accessKey', 'A');
|
||||
Δselect(0);
|
||||
Δproperty('title', 'one')('accessKey', 'A');
|
||||
});
|
||||
expect(t.html).toEqual('<div accesskey="A" title="one"></div>');
|
||||
t.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('title', 'two')('accessKey', 'B');
|
||||
Δselect(0);
|
||||
Δproperty('title', 'two')('accessKey', 'B');
|
||||
});
|
||||
expect(t.html).toEqual('<div accesskey="B" title="two"></div>');
|
||||
expect(ngDevMode).toHaveProperties({
|
||||
@ -159,13 +159,13 @@ describe('instructions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should error in dev mode if ɵɵselect was not called prior', () => {
|
||||
it('should error in dev mode if Δselect was not called prior', () => {
|
||||
const t = new TemplateFixture(createDiv, () => {}, 1, 1);
|
||||
expect(() => { t.update(() => { ɵɵproperty('title', 'test'); }); }).toThrow();
|
||||
expect(() => { t.update(() => { Δproperty('title', 'test'); }); }).toThrow();
|
||||
expect(() => {
|
||||
t.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('title', 'test');
|
||||
Δselect(0);
|
||||
Δproperty('title', 'test');
|
||||
});
|
||||
}).not.toThrow();
|
||||
});
|
||||
@ -174,20 +174,20 @@ describe('instructions', () => {
|
||||
describe('styleProp', () => {
|
||||
it('should automatically sanitize unless a bypass operation is applied', () => {
|
||||
const t = new TemplateFixture(() => {
|
||||
return createDiv(null, null, null, ['background-image'], ɵɵdefaultStyleSanitizer);
|
||||
return createDiv(null, null, null, ['background-image'], ΔdefaultStyleSanitizer);
|
||||
}, () => {}, 1);
|
||||
t.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleProp(0, 'url("http://server")');
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleProp(0, 'url("http://server")');
|
||||
ΔstylingApply();
|
||||
});
|
||||
// nothing is set because sanitizer suppresses it.
|
||||
expect(t.html).toEqual('<div></div>');
|
||||
|
||||
t.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleProp(0, bypassSanitizationTrustStyle('url("http://server2")'));
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleProp(0, bypassSanitizationTrustStyle('url("http://server2")'));
|
||||
ΔstylingApply();
|
||||
});
|
||||
expect((t.hostElement.firstChild as HTMLElement).style.getPropertyValue('background-image'))
|
||||
.toEqual('url("http://server2")');
|
||||
@ -201,18 +201,18 @@ describe('instructions', () => {
|
||||
1, sanitizerInterceptor);
|
||||
|
||||
t.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleProp(0, bypassSanitizationTrustStyle('apple'));
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleProp(0, bypassSanitizationTrustStyle('apple'));
|
||||
ΔstylingApply();
|
||||
});
|
||||
|
||||
expect(sanitizerInterceptor.lastValue !).toEqual('apple');
|
||||
sanitizerInterceptor.lastValue = null;
|
||||
|
||||
t.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleProp(0, bypassSanitizationTrustStyle('apple'));
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleProp(0, bypassSanitizationTrustStyle('apple'));
|
||||
ΔstylingApply();
|
||||
});
|
||||
expect(sanitizerInterceptor.lastValue).toEqual(null);
|
||||
});
|
||||
@ -220,17 +220,17 @@ describe('instructions', () => {
|
||||
|
||||
describe('styleMap', () => {
|
||||
function createDivWithStyle() {
|
||||
ɵɵelementStart(0, 'div', [AttributeMarker.Styles, 'height', '10px']);
|
||||
ɵɵstyling([], ['height']);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', [AttributeMarker.Styles, 'height', '10px']);
|
||||
Δstyling([], ['height']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
|
||||
it('should add style', () => {
|
||||
const fixture = new TemplateFixture(createDivWithStyle, () => {}, 1);
|
||||
fixture.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleMap({'background-color': 'red'});
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleMap({'background-color': 'red'});
|
||||
ΔstylingApply();
|
||||
});
|
||||
expect(fixture.html).toEqual('<div style="background-color: red; height: 10px;"></div>');
|
||||
});
|
||||
@ -244,8 +244,8 @@ describe('instructions', () => {
|
||||
sanitizerInterceptor);
|
||||
|
||||
fixture.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleMap({
|
||||
Δselect(0);
|
||||
ΔstyleMap({
|
||||
'background-image': 'background-image',
|
||||
'background': 'background',
|
||||
'border-image': 'border-image',
|
||||
@ -254,7 +254,7 @@ describe('instructions', () => {
|
||||
'filter': 'filter',
|
||||
'width': 'width'
|
||||
});
|
||||
ɵɵstylingApply();
|
||||
ΔstylingApply();
|
||||
});
|
||||
|
||||
const props = detectedValues.sort();
|
||||
@ -266,17 +266,17 @@ describe('instructions', () => {
|
||||
|
||||
describe('elementClass', () => {
|
||||
function createDivWithStyling() {
|
||||
ɵɵelementStart(0, 'div');
|
||||
ɵɵstyling();
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div');
|
||||
Δstyling();
|
||||
ΔelementEnd();
|
||||
}
|
||||
|
||||
it('should add class', () => {
|
||||
const fixture = new TemplateFixture(createDivWithStyling, () => {}, 1);
|
||||
fixture.update(() => {
|
||||
ɵɵselect(0);
|
||||
ɵɵclassMap('multiple classes');
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔclassMap('multiple classes');
|
||||
ΔstylingApply();
|
||||
});
|
||||
expect(fixture.html).toEqual('<div class="multiple classes"></div>');
|
||||
});
|
||||
@ -289,26 +289,26 @@ describe('instructions', () => {
|
||||
|
||||
function ToDoAppComponent_NgForOf_Template_0(rf: RenderFlags, ctx0: NgForOfContext<any>) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'ul');
|
||||
ɵɵtemplate(1, ToDoAppComponent_NgForOf_NgForOf_Template_1, 2, 1, 'li', _c1);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'ul');
|
||||
Δtemplate(1, ToDoAppComponent_NgForOf_NgForOf_Template_1, 2, 1, 'li', _c1);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
const row_r2 = ctx0.$implicit;
|
||||
ɵɵelementProperty(1, 'ngForOf', ɵɵbind(row_r2));
|
||||
ΔelementProperty(1, 'ngForOf', Δbind(row_r2));
|
||||
}
|
||||
}
|
||||
|
||||
function ToDoAppComponent_NgForOf_NgForOf_Template_1(
|
||||
rf: RenderFlags, ctx1: NgForOfContext<any>) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'li');
|
||||
ɵɵtext(1);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'li');
|
||||
Δtext(1);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
const col_r3 = ctx1.$implicit;
|
||||
ɵɵtextBinding(1, ɵɵinterpolation1('', col_r3, ''));
|
||||
ΔtextBinding(1, Δinterpolation1('', col_r3, ''));
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ describe('instructions', () => {
|
||||
class NestedLoops {
|
||||
rows = [['a', 'b'], ['A', 'B'], ['a', 'b'], ['A', 'B']];
|
||||
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: NestedLoops,
|
||||
selectors: [['nested-loops']],
|
||||
factory: function ToDoAppComponent_Factory() { return new NestedLoops(); },
|
||||
@ -328,10 +328,10 @@ describe('instructions', () => {
|
||||
vars: 1,
|
||||
template: function ToDoAppComponent_Template(rf: RenderFlags, ctx: NestedLoops) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵtemplate(0, ToDoAppComponent_NgForOf_Template_0, 2, 1, 'ul', _c0);
|
||||
Δtemplate(0, ToDoAppComponent_NgForOf_Template_0, 2, 1, 'ul', _c0);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵelementProperty(0, 'ngForOf', ɵɵbind(ctx.rows));
|
||||
ΔelementProperty(0, 'ngForOf', Δbind(ctx.rows));
|
||||
}
|
||||
},
|
||||
directives: [NgForOf]
|
||||
@ -353,7 +353,7 @@ describe('instructions', () => {
|
||||
const inputValue = 'http://foo';
|
||||
const outputValue = 'http://foo-sanitized';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'href', inputValue, ɵɵsanitizeUrl));
|
||||
t.update(() => ΔelementAttribute(0, 'href', inputValue, ΔsanitizeUrl));
|
||||
expect(t.html).toEqual(`<a href="${outputValue}"></a>`);
|
||||
expect(s.lastSanitizedValue).toEqual(outputValue);
|
||||
});
|
||||
@ -364,7 +364,7 @@ describe('instructions', () => {
|
||||
const inputValue = s.bypassSecurityTrustUrl('http://foo');
|
||||
const outputValue = 'http://foo';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'href', inputValue, ɵɵsanitizeUrl));
|
||||
t.update(() => ΔelementAttribute(0, 'href', inputValue, ΔsanitizeUrl));
|
||||
expect(t.html).toEqual(`<a href="${outputValue}"></a>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -375,7 +375,7 @@ describe('instructions', () => {
|
||||
const inputValue = bypassSanitizationTrustUrl('http://foo');
|
||||
const outputValue = 'http://foo-ivy';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'href', inputValue, ɵɵsanitizeUrl));
|
||||
t.update(() => ΔelementAttribute(0, 'href', inputValue, ΔsanitizeUrl));
|
||||
expect(t.html).toEqual(`<a href="${outputValue}"></a>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -386,7 +386,7 @@ describe('instructions', () => {
|
||||
const inputValue = 'color:red';
|
||||
const outputValue = 'color:blue';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'style', inputValue, ɵɵsanitizeStyle));
|
||||
t.update(() => ΔelementAttribute(0, 'style', inputValue, ΔsanitizeStyle));
|
||||
expect(stripStyleWsCharacters(t.html)).toEqual(`<div style="${outputValue}"></div>`);
|
||||
expect(s.lastSanitizedValue).toEqual(outputValue);
|
||||
});
|
||||
@ -397,7 +397,7 @@ describe('instructions', () => {
|
||||
const inputValue = s.bypassSecurityTrustStyle('color:maroon');
|
||||
const outputValue = 'color:maroon';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'style', inputValue, ɵɵsanitizeStyle));
|
||||
t.update(() => ΔelementAttribute(0, 'style', inputValue, ΔsanitizeStyle));
|
||||
expect(stripStyleWsCharacters(t.html)).toEqual(`<div style="${outputValue}"></div>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -408,7 +408,7 @@ describe('instructions', () => {
|
||||
const inputValue = bypassSanitizationTrustStyle('font-family:foo');
|
||||
const outputValue = 'font-family:foo-ivy';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'style', inputValue, ɵɵsanitizeStyle));
|
||||
t.update(() => ΔelementAttribute(0, 'style', inputValue, ΔsanitizeStyle));
|
||||
expect(stripStyleWsCharacters(t.html)).toEqual(`<div style="${outputValue}"></div>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -419,7 +419,7 @@ describe('instructions', () => {
|
||||
const inputValue = 'http://resource';
|
||||
const outputValue = 'http://resource-sanitized';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'src', inputValue, ɵɵsanitizeResourceUrl));
|
||||
t.update(() => ΔelementAttribute(0, 'src', inputValue, ΔsanitizeResourceUrl));
|
||||
expect(t.html).toEqual(`<script src="${outputValue}"></script>`);
|
||||
expect(s.lastSanitizedValue).toEqual(outputValue);
|
||||
});
|
||||
@ -430,7 +430,7 @@ describe('instructions', () => {
|
||||
const inputValue = s.bypassSecurityTrustResourceUrl('file://all-my-secrets.pdf');
|
||||
const outputValue = 'file://all-my-secrets.pdf';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'src', inputValue, ɵɵsanitizeResourceUrl));
|
||||
t.update(() => ΔelementAttribute(0, 'src', inputValue, ΔsanitizeResourceUrl));
|
||||
expect(t.html).toEqual(`<script src="${outputValue}"></script>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -441,7 +441,7 @@ describe('instructions', () => {
|
||||
const inputValue = bypassSanitizationTrustResourceUrl('file://all-my-secrets.pdf');
|
||||
const outputValue = 'file://all-my-secrets.pdf-ivy';
|
||||
|
||||
t.update(() => ɵɵelementAttribute(0, 'src', inputValue, ɵɵsanitizeResourceUrl));
|
||||
t.update(() => ΔelementAttribute(0, 'src', inputValue, ΔsanitizeResourceUrl));
|
||||
expect(t.html).toEqual(`<script src="${outputValue}"></script>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -452,7 +452,7 @@ describe('instructions', () => {
|
||||
const inputValue = 'fn();';
|
||||
const outputValue = 'fn(); //sanitized';
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeScript));
|
||||
t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeScript));
|
||||
expect(t.html).toEqual(`<script>${outputValue}</script>`);
|
||||
expect(s.lastSanitizedValue).toEqual(outputValue);
|
||||
});
|
||||
@ -463,7 +463,7 @@ describe('instructions', () => {
|
||||
const inputValue = s.bypassSecurityTrustScript('alert("bar")');
|
||||
const outputValue = 'alert("bar")';
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeScript));
|
||||
t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeScript));
|
||||
expect(t.html).toEqual(`<script>${outputValue}</script>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -474,7 +474,7 @@ describe('instructions', () => {
|
||||
const inputValue = bypassSanitizationTrustScript('alert("bar")');
|
||||
const outputValue = 'alert("bar")-ivy';
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeScript));
|
||||
t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeScript));
|
||||
expect(t.html).toEqual(`<script>${outputValue}</script>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -485,7 +485,7 @@ describe('instructions', () => {
|
||||
const inputValue = '<header></header>';
|
||||
const outputValue = '<header></header> <!--sanitized-->';
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeHtml));
|
||||
t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeHtml));
|
||||
expect(t.html).toEqual(`<div>${outputValue}</div>`);
|
||||
expect(s.lastSanitizedValue).toEqual(outputValue);
|
||||
});
|
||||
@ -496,7 +496,7 @@ describe('instructions', () => {
|
||||
const inputValue = s.bypassSecurityTrustHtml('<div onclick="alert(123)"></div>');
|
||||
const outputValue = '<div onclick="alert(123)"></div>';
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeHtml));
|
||||
t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeHtml));
|
||||
expect(t.html).toEqual(`<div>${outputValue}</div>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -507,7 +507,7 @@ describe('instructions', () => {
|
||||
const inputValue = bypassSanitizationTrustHtml('<div onclick="alert(123)"></div>');
|
||||
const outputValue = '<div onclick="alert(123)"></div>-ivy';
|
||||
|
||||
t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeHtml));
|
||||
t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeHtml));
|
||||
expect(t.html).toEqual(`<div>${outputValue}</div>`);
|
||||
expect(s.lastSanitizedValue).toBeFalsy();
|
||||
});
|
||||
@ -552,7 +552,7 @@ class LocalMockSanitizer implements Sanitizer {
|
||||
class MockSanitizerInterceptor {
|
||||
public lastValue: string|null = null;
|
||||
constructor(private _interceptorFn?: ((value: any) => any)|null) {}
|
||||
getStyleSanitizer() { return ɵɵdefaultStyleSanitizer; }
|
||||
getStyleSanitizer() { return ΔdefaultStyleSanitizer; }
|
||||
sanitize(context: SecurityContext, value: LocalSanitizedValue|string|null|any): string|null {
|
||||
if (this._interceptorFn) {
|
||||
this._interceptorFn(value);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
@ -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
@ -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
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
import {EventEmitter} from '@angular/core';
|
||||
|
||||
import {ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index';
|
||||
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵlistener, ɵɵtext} from '../../src/render3/instructions/all';
|
||||
import {ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index';
|
||||
import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δlistener, Δtext} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
|
||||
import {renderToHtml} from './render_util';
|
||||
@ -21,7 +21,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) {},
|
||||
@ -37,7 +37,7 @@ describe('outputs', () => {
|
||||
class OtherDir {
|
||||
changeStream = new EventEmitter();
|
||||
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
static ngDirectiveDef = ΔdefineDirective({
|
||||
type: OtherDir,
|
||||
selectors: [['', 'otherDir', '']],
|
||||
factory: () => otherDir = new OtherDir,
|
||||
@ -60,39 +60,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Directive as _Directive, Pipe as _Pipe, PipeTransform, WrappedValue, ɵɵdefinePipe} from '@angular/core';
|
||||
import {Directive as _Directive, Pipe as _Pipe, PipeTransform, WrappedValue, ΔdefinePipe} from '@angular/core';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
import {ɵɵinterpolation1, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all';
|
||||
import {ɵɵpipe, ɵɵpipeBind1} from '../../src/render3/pipe';
|
||||
import {Δinterpolation1, Δtext, ΔtextBinding} from '../../src/render3/instructions/all';
|
||||
import {Δpipe, ΔpipeBind1} from '../../src/render3/pipe';
|
||||
|
||||
import {TemplateFixture} from './render_util';
|
||||
|
||||
@ -29,7 +29,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(); },
|
||||
@ -38,13 +38,11 @@ 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 =
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 {ɵɵdefineComponent} from '../../src/render3/index';
|
||||
import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart} from '../../src/render3/instructions/all';
|
||||
import {ΔdefineComponent} from '../../src/render3/index';
|
||||
import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
import {ɵɵpureFunction2} from '../../src/render3/pure_function';
|
||||
import {ΔpureFunction2} from '../../src/render3/pure_function';
|
||||
import {getDirectiveOnNode, renderToHtml} from '../../test/render3/render_util';
|
||||
|
||||
|
||||
@ -19,7 +19,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(); },
|
||||
@ -45,27 +45,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
@ -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(),
|
||||
|
@ -7,8 +7,8 @@
|
||||
*/
|
||||
|
||||
import {RendererType2, ViewEncapsulation} from '../../src/core';
|
||||
import {ɵɵdefineComponent} from '../../src/render3/index';
|
||||
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵtext} from '../../src/render3/instructions/all';
|
||||
import {ΔdefineComponent} from '../../src/render3/index';
|
||||
import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δtext} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
|
||||
import {getRendererFactory2} from './imported_renderer2';
|
||||
@ -26,7 +26,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']],
|
||||
@ -35,7 +35,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');
|
||||
@ -46,7 +46,7 @@ describe('renderer factory lifecycle', () => {
|
||||
}
|
||||
|
||||
class SomeComponentWhichThrows {
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: SomeComponentWhichThrows,
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
selectors: [['some-component-with-Error']],
|
||||
@ -62,7 +62,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');
|
||||
@ -74,8 +74,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');
|
||||
@ -114,27 +114,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(
|
||||
@ -150,7 +150,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']],
|
||||
@ -158,7 +158,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,
|
||||
@ -168,27 +168,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(
|
||||
|
@ -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 {ɵɵclassMap, ɵɵclassProp, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵelementEnd, ɵɵelementStart, ɵɵnamespaceSVG, ɵɵselect, ɵɵstyleMap, ɵɵstyleProp, ɵɵstyling, ɵɵstylingApply} from '../../../src/render3/index';
|
||||
import {ΔclassMap, ΔclassProp, ΔdefineComponent, ΔdefineDirective, ΔelementEnd, ΔelementStart, ΔnamespaceSVG, Δselect, ΔstyleMap, ΔstyleProp, Δstyling, ΔstylingApply} 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';
|
||||
|
||||
@ -383,7 +383,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',
|
||||
@ -392,14 +392,14 @@ describe('style and class based bindings', () => {
|
||||
'opacity',
|
||||
'0.5',
|
||||
]);
|
||||
ɵɵstyling(null, ['width']);
|
||||
ɵɵelementEnd();
|
||||
Δstyling(null, ['width']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleMap(ctx.myStyles);
|
||||
ɵɵstyleProp(0, ctx.myWidth);
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleMap(ctx.myStyles);
|
||||
ΔstyleProp(0, ctx.myWidth);
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
|
||||
@ -419,7 +419,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(),
|
||||
@ -427,18 +427,18 @@ describe('style and class based bindings', () => {
|
||||
vars: 0,
|
||||
template: (rf: RenderFlags, ctx: Comp) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵnamespaceSVG();
|
||||
ɵɵelementStart(0, 'svg');
|
||||
ɵɵstyling(null, ['width', 'height']);
|
||||
ɵɵelementStart(1, 'circle', ['stroke', 'green', 'fill', 'yellow']);
|
||||
ɵɵelementEnd();
|
||||
ɵɵelementEnd();
|
||||
ΔnamespaceSVG();
|
||||
ΔelementStart(0, 'svg');
|
||||
Δstyling(null, ['width', 'height']);
|
||||
ΔelementStart(1, 'circle', ['stroke', 'green', 'fill', 'yellow']);
|
||||
ΔelementEnd();
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleProp(0, ctx.diameter, 'px');
|
||||
ɵɵstyleProp(1, ctx.diameter, 'px');
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleProp(0, ctx.diameter, 'px');
|
||||
ΔstyleProp(1, ctx.diameter, 'px');
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -462,7 +462,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(),
|
||||
@ -470,15 +470,15 @@ describe('style and class based bindings', () => {
|
||||
vars: 0,
|
||||
template: (rf: RenderFlags, ctx: Comp) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div');
|
||||
ɵɵstyling(null, ['borderWidth', 'border-color']);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div');
|
||||
Δstyling(null, ['borderWidth', 'border-color']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleProp(0, ctx.borderWidth);
|
||||
ɵɵstyleProp(1, ctx.borderColor);
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleProp(0, ctx.borderWidth);
|
||||
ΔstyleProp(1, ctx.borderColor);
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1279,7 +1279,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);
|
||||
|
||||
@ -3099,7 +3099,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],
|
||||
@ -3108,17 +3108,17 @@ describe('style and class based bindings', () => {
|
||||
vars: 0,
|
||||
template: (rf: RenderFlags, ctx: Comp) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div');
|
||||
ɵɵstyling(['foo'], ['width']);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div');
|
||||
Δstyling(['foo'], ['width']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleMap(styleMapFactory);
|
||||
ɵɵclassMap(classMapFactory);
|
||||
ɵɵstyleProp(0, widthFactory);
|
||||
ɵɵclassProp(0, fooFactory);
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleMap(styleMapFactory);
|
||||
ΔclassMap(classMapFactory);
|
||||
ΔstyleProp(0, widthFactory);
|
||||
ΔclassProp(0, fooFactory);
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -3174,7 +3174,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],
|
||||
@ -3183,17 +3183,17 @@ describe('style and class based bindings', () => {
|
||||
vars: 0,
|
||||
template: (rf: RenderFlags, ctx: Comp) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div');
|
||||
ɵɵstyling(['foo'], ['width']);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div');
|
||||
Δstyling(['foo'], ['width']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleMap(styleMapFactory);
|
||||
ɵɵclassMap(classMapFactory);
|
||||
ɵɵstyleProp(0, widthFactory);
|
||||
ɵɵclassProp(0, fooFactory);
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleMap(styleMapFactory);
|
||||
ΔclassMap(classMapFactory);
|
||||
ΔstyleProp(0, widthFactory);
|
||||
ΔclassProp(0, fooFactory);
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -3251,18 +3251,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) {
|
||||
ɵɵstyling(['foo'], ['width']);
|
||||
Δstyling(['foo'], ['width']);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵstyleProp(0, ctx.widthFactory);
|
||||
ɵɵclassProp(0, ctx.fooFactory);
|
||||
ɵɵstylingApply();
|
||||
ΔstyleProp(0, ctx.widthFactory);
|
||||
ΔclassProp(0, ctx.fooFactory);
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -3272,7 +3272,7 @@ describe('style and class based bindings', () => {
|
||||
}
|
||||
|
||||
class Comp {
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: Comp,
|
||||
selectors: [['comp']],
|
||||
directives: [Comp, MyDir],
|
||||
@ -3281,15 +3281,15 @@ describe('style and class based bindings', () => {
|
||||
vars: 0,
|
||||
template: (rf: RenderFlags, ctx: Comp) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div', ['my-dir', '']);
|
||||
ɵɵstyling(['foo'], ['width']);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div', ['my-dir', '']);
|
||||
Δstyling(['foo'], ['width']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵstyleProp(0, ctx.widthFactory);
|
||||
ɵɵclassProp(0, ctx.fooFactory);
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstyleProp(0, ctx.widthFactory);
|
||||
ΔclassProp(0, ctx.fooFactory);
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -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, ɵɵselect, ɵɵstyling, ɵɵstylingApply} from '../../../src/render3/instructions/all';
|
||||
import {getHostElement, ΔdefineComponent, ΔloadViewQuery, ΔviewQuery} from '../../../src/render3/index';
|
||||
import {markDirty, Δelement, ΔelementEnd, ΔelementStart, Δselect, Δstyling, ΔstylingApply} 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,13 +257,13 @@ class CompWithStyling {
|
||||
vars: 0,
|
||||
template: (rf: RenderFlags, ctx: CompWithStyling) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵelementStart(0, 'div');
|
||||
ɵɵstyling(['fooClass']);
|
||||
ɵɵelementEnd();
|
||||
ΔelementStart(0, 'div');
|
||||
Δstyling(['fooClass']);
|
||||
ΔelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵstylingApply();
|
||||
Δselect(0);
|
||||
ΔstylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -272,7 +272,7 @@ class CompWithStyling {
|
||||
}
|
||||
|
||||
class SuperComp {
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
type: SuperComp,
|
||||
selectors: [['super-comp']],
|
||||
factory: () => new SuperComp(),
|
||||
@ -280,18 +280,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>);
|
||||
}
|
||||
},
|
||||
|
@ -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
@ -12,7 +12,7 @@ import {HEADER_OFFSET, LView} from '@angular/core/src/render3/interfaces/view';
|
||||
import {setTNodeAndViewData} from '@angular/core/src/render3/state';
|
||||
|
||||
import {bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl} from '../../src/sanitization/bypass';
|
||||
import {getUrlSanitizer, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl} from '../../src/sanitization/sanitization';
|
||||
import {getUrlSanitizer, ΔsanitizeHtml, ΔsanitizeResourceUrl, ΔsanitizeScript, ΔsanitizeStyle, ΔsanitizeUrl, ΔsanitizeUrlOrResourceUrl} from '../../src/sanitization/sanitization';
|
||||
import {SecurityContext} from '../../src/sanitization/security';
|
||||
|
||||
function fakeLView(): LView {
|
||||
@ -27,54 +27,54 @@ describe('sanitization', () => {
|
||||
toString() { return this.value; }
|
||||
}
|
||||
it('should sanitize html', () => {
|
||||
expect(ɵɵsanitizeHtml('<div></div>')).toEqual('<div></div>');
|
||||
expect(ɵɵsanitizeHtml(new Wrap('<div></div>'))).toEqual('<div></div>');
|
||||
expect(ɵɵsanitizeHtml('<img src="javascript:true">'))
|
||||
expect(ΔsanitizeHtml('<div></div>')).toEqual('<div></div>');
|
||||
expect(ΔsanitizeHtml(new Wrap('<div></div>'))).toEqual('<div></div>');
|
||||
expect(ΔsanitizeHtml('<img src="javascript:true">'))
|
||||
.toEqual('<img src="unsafe:javascript:true">');
|
||||
expect(ɵɵsanitizeHtml(new Wrap('<img src="javascript:true">')))
|
||||
expect(ΔsanitizeHtml(new Wrap('<img src="javascript:true">')))
|
||||
.toEqual('<img src="unsafe:javascript:true">');
|
||||
expect(ɵɵsanitizeHtml(bypassSanitizationTrustUrl('<img src="javascript:true">')))
|
||||
expect(ΔsanitizeHtml(bypassSanitizationTrustUrl('<img src="javascript:true">')))
|
||||
.toEqual('<img src="unsafe:javascript:true">');
|
||||
expect(ɵɵsanitizeHtml(bypassSanitizationTrustHtml('<img src="javascript:true">')))
|
||||
expect(ΔsanitizeHtml(bypassSanitizationTrustHtml('<img src="javascript:true">')))
|
||||
.toEqual('<img src="javascript:true">');
|
||||
});
|
||||
|
||||
it('should sanitize url', () => {
|
||||
expect(ɵɵsanitizeUrl('http://server')).toEqual('http://server');
|
||||
expect(ɵɵsanitizeUrl(new Wrap('http://server'))).toEqual('http://server');
|
||||
expect(ɵɵsanitizeUrl('javascript:true')).toEqual('unsafe:javascript:true');
|
||||
expect(ɵɵsanitizeUrl(new Wrap('javascript:true'))).toEqual('unsafe:javascript:true');
|
||||
expect(ɵɵsanitizeUrl(bypassSanitizationTrustHtml('javascript:true')))
|
||||
expect(ΔsanitizeUrl('http://server')).toEqual('http://server');
|
||||
expect(ΔsanitizeUrl(new Wrap('http://server'))).toEqual('http://server');
|
||||
expect(ΔsanitizeUrl('javascript:true')).toEqual('unsafe:javascript:true');
|
||||
expect(ΔsanitizeUrl(new Wrap('javascript:true'))).toEqual('unsafe:javascript:true');
|
||||
expect(ΔsanitizeUrl(bypassSanitizationTrustHtml('javascript:true')))
|
||||
.toEqual('unsafe:javascript:true');
|
||||
expect(ɵɵsanitizeUrl(bypassSanitizationTrustUrl('javascript:true'))).toEqual('javascript:true');
|
||||
expect(ΔsanitizeUrl(bypassSanitizationTrustUrl('javascript:true'))).toEqual('javascript:true');
|
||||
});
|
||||
|
||||
it('should sanitize resourceUrl', () => {
|
||||
const ERROR = 'unsafe value used in a resource URL context (see http://g.co/ng/security#xss)';
|
||||
expect(() => ɵɵsanitizeResourceUrl('http://server')).toThrowError(ERROR);
|
||||
expect(() => ɵɵsanitizeResourceUrl('javascript:true')).toThrowError(ERROR);
|
||||
expect(() => ɵɵsanitizeResourceUrl(bypassSanitizationTrustHtml('javascript:true')))
|
||||
expect(() => ΔsanitizeResourceUrl('http://server')).toThrowError(ERROR);
|
||||
expect(() => ΔsanitizeResourceUrl('javascript:true')).toThrowError(ERROR);
|
||||
expect(() => ΔsanitizeResourceUrl(bypassSanitizationTrustHtml('javascript:true')))
|
||||
.toThrowError(ERROR);
|
||||
expect(ɵɵsanitizeResourceUrl(bypassSanitizationTrustResourceUrl('javascript:true')))
|
||||
expect(ΔsanitizeResourceUrl(bypassSanitizationTrustResourceUrl('javascript:true')))
|
||||
.toEqual('javascript:true');
|
||||
});
|
||||
|
||||
it('should sanitize style', () => {
|
||||
expect(ɵɵsanitizeStyle('red')).toEqual('red');
|
||||
expect(ɵɵsanitizeStyle(new Wrap('red'))).toEqual('red');
|
||||
expect(ɵɵsanitizeStyle('url("http://server")')).toEqual('unsafe');
|
||||
expect(ɵɵsanitizeStyle(new Wrap('url("http://server")'))).toEqual('unsafe');
|
||||
expect(ɵɵsanitizeStyle(bypassSanitizationTrustHtml('url("http://server")'))).toEqual('unsafe');
|
||||
expect(ɵɵsanitizeStyle(bypassSanitizationTrustStyle('url("http://server")')))
|
||||
expect(ΔsanitizeStyle('red')).toEqual('red');
|
||||
expect(ΔsanitizeStyle(new Wrap('red'))).toEqual('red');
|
||||
expect(ΔsanitizeStyle('url("http://server")')).toEqual('unsafe');
|
||||
expect(ΔsanitizeStyle(new Wrap('url("http://server")'))).toEqual('unsafe');
|
||||
expect(ΔsanitizeStyle(bypassSanitizationTrustHtml('url("http://server")'))).toEqual('unsafe');
|
||||
expect(ΔsanitizeStyle(bypassSanitizationTrustStyle('url("http://server")')))
|
||||
.toEqual('url("http://server")');
|
||||
});
|
||||
|
||||
it('should sanitize script', () => {
|
||||
const ERROR = 'unsafe value used in a script context';
|
||||
expect(() => ɵɵsanitizeScript('true')).toThrowError(ERROR);
|
||||
expect(() => ɵɵsanitizeScript('true')).toThrowError(ERROR);
|
||||
expect(() => ɵɵsanitizeScript(bypassSanitizationTrustHtml('true'))).toThrowError(ERROR);
|
||||
expect(ɵɵsanitizeScript(bypassSanitizationTrustScript('true'))).toEqual('true');
|
||||
expect(() => ΔsanitizeScript('true')).toThrowError(ERROR);
|
||||
expect(() => ΔsanitizeScript('true')).toThrowError(ERROR);
|
||||
expect(() => ΔsanitizeScript(bypassSanitizationTrustHtml('true'))).toThrowError(ERROR);
|
||||
expect(ΔsanitizeScript(bypassSanitizationTrustScript('true'))).toEqual('true');
|
||||
});
|
||||
|
||||
it('should select correct sanitizer for URL props', () => {
|
||||
@ -83,7 +83,7 @@ describe('sanitization', () => {
|
||||
const schema = SECURITY_SCHEMA();
|
||||
const contextsByProp: Map<string, Set<number>> = new Map();
|
||||
const sanitizerNameByContext: Map<number, Function> = new Map([
|
||||
[SecurityContext.URL, ɵɵsanitizeUrl], [SecurityContext.RESOURCE_URL, ɵɵsanitizeResourceUrl]
|
||||
[SecurityContext.URL, ΔsanitizeUrl], [SecurityContext.RESOURCE_URL, ΔsanitizeResourceUrl]
|
||||
]);
|
||||
Object.keys(schema).forEach(key => {
|
||||
const context = schema[key];
|
||||
@ -102,29 +102,28 @@ describe('sanitization', () => {
|
||||
|
||||
it('should sanitize resourceUrls via sanitizeUrlOrResourceUrl', () => {
|
||||
const ERROR = 'unsafe value used in a resource URL context (see http://g.co/ng/security#xss)';
|
||||
expect(() => ɵɵsanitizeUrlOrResourceUrl('http://server', 'iframe', 'src')).toThrowError(ERROR);
|
||||
expect(() => ɵɵsanitizeUrlOrResourceUrl('javascript:true', 'iframe', 'src'))
|
||||
.toThrowError(ERROR);
|
||||
expect(() => ΔsanitizeUrlOrResourceUrl('http://server', 'iframe', 'src')).toThrowError(ERROR);
|
||||
expect(() => ΔsanitizeUrlOrResourceUrl('javascript:true', 'iframe', 'src')).toThrowError(ERROR);
|
||||
expect(
|
||||
() => ɵɵsanitizeUrlOrResourceUrl(
|
||||
() => ΔsanitizeUrlOrResourceUrl(
|
||||
bypassSanitizationTrustHtml('javascript:true'), 'iframe', 'src'))
|
||||
.toThrowError(ERROR);
|
||||
expect(ɵɵsanitizeUrlOrResourceUrl(
|
||||
expect(ΔsanitizeUrlOrResourceUrl(
|
||||
bypassSanitizationTrustResourceUrl('javascript:true'), 'iframe', 'src'))
|
||||
.toEqual('javascript:true');
|
||||
});
|
||||
|
||||
it('should sanitize urls via sanitizeUrlOrResourceUrl', () => {
|
||||
expect(ɵɵsanitizeUrlOrResourceUrl('http://server', 'a', 'href')).toEqual('http://server');
|
||||
expect(ɵɵsanitizeUrlOrResourceUrl(new Wrap('http://server'), 'a', 'href'))
|
||||
expect(ΔsanitizeUrlOrResourceUrl('http://server', 'a', 'href')).toEqual('http://server');
|
||||
expect(ΔsanitizeUrlOrResourceUrl(new Wrap('http://server'), 'a', 'href'))
|
||||
.toEqual('http://server');
|
||||
expect(ɵɵsanitizeUrlOrResourceUrl('javascript:true', 'a', 'href'))
|
||||
expect(ΔsanitizeUrlOrResourceUrl('javascript:true', 'a', 'href'))
|
||||
.toEqual('unsafe:javascript:true');
|
||||
expect(ɵɵsanitizeUrlOrResourceUrl(new Wrap('javascript:true'), 'a', 'href'))
|
||||
expect(ΔsanitizeUrlOrResourceUrl(new Wrap('javascript:true'), 'a', 'href'))
|
||||
.toEqual('unsafe:javascript:true');
|
||||
expect(ɵɵsanitizeUrlOrResourceUrl(bypassSanitizationTrustHtml('javascript:true'), 'a', 'href'))
|
||||
expect(ΔsanitizeUrlOrResourceUrl(bypassSanitizationTrustHtml('javascript:true'), 'a', 'href'))
|
||||
.toEqual('unsafe:javascript:true');
|
||||
expect(ɵɵsanitizeUrlOrResourceUrl(bypassSanitizationTrustUrl('javascript:true'), 'a', 'href'))
|
||||
expect(ΔsanitizeUrlOrResourceUrl(bypassSanitizationTrustUrl('javascript:true'), 'a', 'href'))
|
||||
.toEqual('javascript:true');
|
||||
});
|
||||
});
|
||||
|
@ -6,10 +6,10 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵɵComponentDefWithMeta, ɵɵPipeDefWithMeta as PipeDefWithMeta} from '@angular/core';
|
||||
import {ΔComponentDefWithMeta, ΔPipeDefWithMeta as PipeDefWithMeta} from '@angular/core';
|
||||
|
||||
declare class SuperComponent {
|
||||
static ngComponentDef: ɵɵComponentDefWithMeta<SuperComponent, '[super]', never, {}, {}, never>;
|
||||
static ngComponentDef: ΔComponentDefWithMeta<SuperComponent, '[super]', never, {}, {}, never>;
|
||||
}
|
||||
|
||||
declare class SubComponent extends SuperComponent {
|
||||
@ -18,7 +18,7 @@ declare class SubComponent extends SuperComponent {
|
||||
// would produce type errors when the "strictFunctionTypes" option is enabled.
|
||||
onlyInSubtype: string;
|
||||
|
||||
static ngComponentDef: ɵɵComponentDefWithMeta<SubComponent, '[sub]', never, {}, {}, never>;
|
||||
static ngComponentDef: ΔComponentDefWithMeta<SubComponent, '[sub]', never, {}, {}, never>;
|
||||
}
|
||||
|
||||
declare class SuperPipe { static ngPipeDef: PipeDefWithMeta<SuperPipe, 'super'>; }
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Component, Directive, ErrorHandler, Inject, Injectable, InjectionToken, Input, NgModule, Optional, Pipe, ɵsetClassMetadata as setClassMetadata, ɵɵdefineComponent as defineComponent, ɵɵtext as text} from '@angular/core';
|
||||
import {Component, Directive, ErrorHandler, Inject, Injectable, InjectionToken, Input, NgModule, Optional, Pipe, ɵsetClassMetadata as setClassMetadata, ΔdefineComponent as defineComponent, Δtext as text} from '@angular/core';
|
||||
import {TestBed, getTestBed} from '@angular/core/testing/src/test_bed';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
@ -10,7 +10,7 @@ import {NgModuleRef} from '@angular/core';
|
||||
import {InjectFlags, inject} from '@angular/core/src/di';
|
||||
import {Injector} from '@angular/core/src/di/injector';
|
||||
import {INJECTOR} from '@angular/core/src/di/injector_compatibility';
|
||||
import {ɵɵInjectableDef, ɵɵdefineInjectable} from '@angular/core/src/di/interface/defs';
|
||||
import {ΔInjectableDef, ΔdefineInjectable} from '@angular/core/src/di/interface/defs';
|
||||
import {NgModuleDefinition, NgModuleProviderDef, NodeFlags} from '@angular/core/src/view';
|
||||
import {moduleDef} from '@angular/core/src/view/ng_module';
|
||||
import {createNgModuleRef} from '@angular/core/src/view/refs';
|
||||
@ -27,14 +27,14 @@ class MyChildModule {}
|
||||
class NotMyModule {}
|
||||
|
||||
class Bar {
|
||||
static ngInjectableDef: ɵɵInjectableDef<Bar> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<Bar> = ΔdefineInjectable({
|
||||
factory: () => new Bar(),
|
||||
providedIn: MyModule,
|
||||
});
|
||||
}
|
||||
|
||||
class Baz {
|
||||
static ngInjectableDef: ɵɵInjectableDef<Baz> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<Baz> = ΔdefineInjectable({
|
||||
factory: () => new Baz(),
|
||||
providedIn: NotMyModule,
|
||||
});
|
||||
@ -43,7 +43,7 @@ class Baz {
|
||||
class HasNormalDep {
|
||||
constructor(public foo: Foo) {}
|
||||
|
||||
static ngInjectableDef: ɵɵInjectableDef<HasNormalDep> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<HasNormalDep> = ΔdefineInjectable({
|
||||
factory: () => new HasNormalDep(inject(Foo)),
|
||||
providedIn: MyModule,
|
||||
});
|
||||
@ -52,7 +52,7 @@ class HasNormalDep {
|
||||
class HasDefinedDep {
|
||||
constructor(public bar: Bar) {}
|
||||
|
||||
static ngInjectableDef: ɵɵInjectableDef<HasDefinedDep> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<HasDefinedDep> = ΔdefineInjectable({
|
||||
factory: () => new HasDefinedDep(inject(Bar)),
|
||||
providedIn: MyModule,
|
||||
});
|
||||
@ -61,14 +61,14 @@ class HasDefinedDep {
|
||||
class HasOptionalDep {
|
||||
constructor(public baz: Baz|null) {}
|
||||
|
||||
static ngInjectableDef: ɵɵInjectableDef<HasOptionalDep> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<HasOptionalDep> = ΔdefineInjectable({
|
||||
factory: () => new HasOptionalDep(inject(Baz, InjectFlags.Optional)),
|
||||
providedIn: MyModule,
|
||||
});
|
||||
}
|
||||
|
||||
class ChildDep {
|
||||
static ngInjectableDef: ɵɵInjectableDef<ChildDep> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<ChildDep> = ΔdefineInjectable({
|
||||
factory: () => new ChildDep(),
|
||||
providedIn: MyChildModule,
|
||||
});
|
||||
@ -76,7 +76,7 @@ class ChildDep {
|
||||
|
||||
class FromChildWithOptionalDep {
|
||||
constructor(public baz: Baz|null) {}
|
||||
static ngInjectableDef: ɵɵInjectableDef<FromChildWithOptionalDep> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<FromChildWithOptionalDep> = ΔdefineInjectable({
|
||||
factory: () => new FromChildWithOptionalDep(inject(Baz, InjectFlags.Default)),
|
||||
providedIn: MyChildModule,
|
||||
});
|
||||
@ -86,7 +86,7 @@ class FromChildWithSkipSelfDep {
|
||||
constructor(
|
||||
public skipSelfChildDep: ChildDep|null, public selfChildDep: ChildDep|null,
|
||||
public optionalSelfBar: Bar|null) {}
|
||||
static ngInjectableDef: ɵɵInjectableDef<FromChildWithSkipSelfDep> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<FromChildWithSkipSelfDep> = ΔdefineInjectable({
|
||||
factory: () => new FromChildWithSkipSelfDep(
|
||||
inject(ChildDep, InjectFlags.SkipSelf|InjectFlags.Optional),
|
||||
inject(ChildDep, InjectFlags.Self),
|
||||
@ -209,7 +209,7 @@ describe('NgModuleRef_ injector', () => {
|
||||
|
||||
ngOnDestroy(): void { Service.destroyed++; }
|
||||
|
||||
static ngInjectableDef: ɵɵInjectableDef<Service> = ɵɵdefineInjectable({
|
||||
static ngInjectableDef: ΔInjectableDef<Service> = ΔdefineInjectable({
|
||||
factory: () => new Service(),
|
||||
providedIn: 'root',
|
||||
});
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ApplicationInitStatus, COMPILER_OPTIONS, Compiler, Component, Directive, ModuleWithComponentFactories, NgModule, NgModuleFactory, NgZone, Injector, Pipe, PlatformRef, Provider, Type, ɵcompileComponent as compileComponent, ɵcompileDirective as compileDirective, ɵcompileNgModuleDefs as compileNgModuleDefs, ɵcompilePipe as compilePipe, ɵgetInjectableDef as getInjectableDef, ɵNG_COMPONENT_DEF as NG_COMPONENT_DEF, ɵNG_DIRECTIVE_DEF as NG_DIRECTIVE_DEF, ɵNG_INJECTOR_DEF as NG_INJECTOR_DEF, ɵNG_MODULE_DEF as NG_MODULE_DEF, ɵNG_PIPE_DEF as NG_PIPE_DEF, ɵRender3ComponentFactory as ComponentFactory, ɵRender3NgModuleRef as NgModuleRef, ɵɵInjectableDef as InjectableDef, ɵNgModuleFactory as R3NgModuleFactory, ɵNgModuleTransitiveScopes as NgModuleTransitiveScopes, ɵNgModuleType as NgModuleType, ɵDirectiveDef as DirectiveDef, ɵpatchComponentDefWithScope as patchComponentDefWithScope, ɵtransitiveScopesFor as transitiveScopesFor,} from '@angular/core';
|
||||
import {ApplicationInitStatus, COMPILER_OPTIONS, Compiler, Component, Directive, ModuleWithComponentFactories, NgModule, NgModuleFactory, NgZone, Injector, Pipe, PlatformRef, Provider, Type, ɵcompileComponent as compileComponent, ɵcompileDirective as compileDirective, ɵcompileNgModuleDefs as compileNgModuleDefs, ɵcompilePipe as compilePipe, ɵgetInjectableDef as getInjectableDef, ɵNG_COMPONENT_DEF as NG_COMPONENT_DEF, ɵNG_DIRECTIVE_DEF as NG_DIRECTIVE_DEF, ɵNG_INJECTOR_DEF as NG_INJECTOR_DEF, ɵNG_MODULE_DEF as NG_MODULE_DEF, ɵNG_PIPE_DEF as NG_PIPE_DEF, ɵRender3ComponentFactory as ComponentFactory, ɵRender3NgModuleRef as NgModuleRef, ΔInjectableDef as InjectableDef, ɵNgModuleFactory as R3NgModuleFactory, ɵNgModuleTransitiveScopes as NgModuleTransitiveScopes, ɵNgModuleType as NgModuleType, ɵDirectiveDef as DirectiveDef, ɵpatchComponentDefWithScope as patchComponentDefWithScope, ɵtransitiveScopesFor as transitiveScopesFor,} from '@angular/core';
|
||||
import {ResourceLoader} from '@angular/compiler';
|
||||
|
||||
import {clearResolutionOfComponentResourcesQueue, restoreComponentResolutionQueue, resolveComponentResources, isComponentDefPendingResolution} from '../../src/metadata/resource_loading';
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ApplicationInitStatus, CompilerOptions, Component, Directive, InjectFlags, InjectionToken, Injector, NgModule, NgModuleFactory, NgModuleRef, NgZone, Optional, Pipe, PlatformRef, Provider, SchemaMetadata, SkipSelf, StaticProvider, Type, ɵAPP_ROOT as APP_ROOT, ɵDepFlags as DepFlags, ɵNodeFlags as NodeFlags, ɵclearOverrides as clearOverrides, ɵgetInjectableDef as getInjectableDef, ɵivyEnabled as ivyEnabled, ɵoverrideComponentView as overrideComponentView, ɵoverrideProvider as overrideProvider, ɵstringify as stringify, ɵɵInjectableDef} from '@angular/core';
|
||||
import {ApplicationInitStatus, CompilerOptions, Component, Directive, InjectFlags, InjectionToken, Injector, NgModule, NgModuleFactory, NgModuleRef, NgZone, Optional, Pipe, PlatformRef, Provider, SchemaMetadata, SkipSelf, StaticProvider, Type, ɵAPP_ROOT as APP_ROOT, ɵDepFlags as DepFlags, ɵNodeFlags as NodeFlags, ɵclearOverrides as clearOverrides, ɵgetInjectableDef as getInjectableDef, ɵivyEnabled as ivyEnabled, ɵoverrideComponentView as overrideComponentView, ɵoverrideProvider as overrideProvider, ɵstringify as stringify, ΔInjectableDef} from '@angular/core';
|
||||
|
||||
import {AsyncTestCompleter} from './async_test_completer';
|
||||
import {ComponentFixture} from './component_fixture';
|
||||
@ -559,7 +559,7 @@ export class TestBedViewEngine implements Injector, TestBed {
|
||||
deps?: any[],
|
||||
},
|
||||
deprecated = false): void {
|
||||
let def: ɵɵInjectableDef<any>|null = null;
|
||||
let def: ΔInjectableDef<any>|null = null;
|
||||
if (typeof token !== 'string' && (def = getInjectableDef(token)) && def.providedIn === 'root') {
|
||||
if (provider.useFactory) {
|
||||
this._rootProviderOverrides.push(
|
||||
|
Reference in New Issue
Block a user