2016-06-23 09:47:54 -07:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2017-02-27 13:28:41 -08:00
|
|
|
import {ANALYZE_FOR_ENTRY_COMPONENTS, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ComponentRef, ElementRef, Injector, LOCALE_ID, NgModuleFactory, QueryList, RenderComponentType, Renderer, SecurityContext, SimpleChange, TRANSLATIONS_FORMAT, TemplateRef, ViewContainerRef, ViewEncapsulation, ɵAnimationGroupPlayer, ɵAnimationKeyframe, ɵAnimationSequencePlayer, ɵAnimationStyles, ɵAnimationTransition, ɵAppView, ɵChangeDetectorStatus, ɵCodegenComponentFactoryResolver, ɵComponentRef_, ɵDebugAppView, ɵDebugContext, ɵEMPTY_ARRAY, ɵEMPTY_INLINE_ARRAY, ɵEMPTY_MAP, ɵInlineArray16, ɵInlineArray2, ɵInlineArray4, ɵInlineArray8, ɵInlineArrayDynamic, ɵNgModuleInjector, ɵNoOpAnimationPlayer, ɵStaticNodeDebugInfo, ɵTemplateRef_, ɵValueUnwrapper, ɵViewContainer, ɵViewType, ɵViewUtils, ɵand, ɵbalanceAnimationKeyframes, ɵcastByValue, ɵccf, ɵcheckBinding, ɵcheckBindingChange, ɵcheckRenderAttribute, ɵcheckRenderClass, ɵcheckRenderProperty, ɵcheckRenderStyle, ɵcheckRenderText, ɵclearStyles, ɵcollectAndResolveStyles, ɵcreateRenderComponentType, ɵcreateRenderElement, ɵcrt, ɵdevModeEqual, ɵdid, ɵeld, ɵinlineInterpolate, ɵinterpolate, ɵncd, ɵnoop, ɵnov, ɵpad, ɵpid, ɵpod, ɵppd, ɵprd, ɵprepareFinalAnimationStyles, ɵpureProxy1, ɵpureProxy10, ɵpureProxy2, ɵpureProxy3, ɵpureProxy4, ɵpureProxy5, ɵpureProxy6, ɵpureProxy7, ɵpureProxy8, ɵpureProxy9, ɵqud, ɵreflector, ɵregisterModuleFactory, ɵrenderStyles, ɵselectOrCreateRenderHostElement, ɵsetBindingDebugInfo, ɵsetBindingDebugInfoForChanges, ɵsubscribeToRenderElement, ɵted, ɵunv, ɵvid} from '@angular/core';
|
2016-08-22 17:18:25 -07:00
|
|
|
|
2017-01-04 13:59:43 -08:00
|
|
|
import {CompileIdentifierMetadata, CompileTokenMetadata} from './compile_metadata';
|
2016-01-06 14:13:44 -08:00
|
|
|
|
2017-02-14 13:33:06 -08:00
|
|
|
const CORE = assetUrl('core');
|
2016-11-12 14:08:58 +01:00
|
|
|
const VIEW_UTILS_MODULE_URL = assetUrl('core', 'linker/view_utils');
|
2016-01-06 14:13:44 -08:00
|
|
|
|
2016-08-24 17:39:49 -07:00
|
|
|
export interface IdentifierSpec {
|
|
|
|
name: string;
|
|
|
|
moduleUrl: string;
|
|
|
|
runtime: any;
|
|
|
|
}
|
|
|
|
|
2016-01-06 14:13:44 -08:00
|
|
|
export class Identifiers {
|
2016-08-24 17:39:49 -07:00
|
|
|
static ANALYZE_FOR_ENTRY_COMPONENTS: IdentifierSpec = {
|
2016-07-25 00:36:30 -07:00
|
|
|
name: 'ANALYZE_FOR_ENTRY_COMPONENTS',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2016-07-25 00:36:30 -07:00
|
|
|
runtime: ANALYZE_FOR_ENTRY_COMPONENTS
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
2017-01-27 17:39:48 -08:00
|
|
|
static ViewUtils: IdentifierSpec = {name: 'ɵViewUtils', moduleUrl: CORE, runtime: ɵViewUtils};
|
2017-02-14 13:33:06 -08:00
|
|
|
static AppView: IdentifierSpec = {name: 'ɵAppView', moduleUrl: CORE, runtime: ɵAppView};
|
|
|
|
static DebugAppView:
|
|
|
|
IdentifierSpec = {name: 'ɵDebugAppView', moduleUrl: CORE, runtime: ɵDebugAppView};
|
|
|
|
static ViewContainer:
|
|
|
|
IdentifierSpec = {name: 'ɵViewContainer', moduleUrl: CORE, runtime: ɵViewContainer};
|
|
|
|
static ElementRef: IdentifierSpec = {name: 'ElementRef', moduleUrl: CORE, runtime: ElementRef};
|
|
|
|
static ViewContainerRef:
|
|
|
|
IdentifierSpec = {name: 'ViewContainerRef', moduleUrl: CORE, runtime: ViewContainerRef};
|
|
|
|
static ChangeDetectorRef:
|
|
|
|
IdentifierSpec = {name: 'ChangeDetectorRef', moduleUrl: CORE, runtime: ChangeDetectorRef};
|
|
|
|
static RenderComponentType:
|
|
|
|
IdentifierSpec = {name: 'RenderComponentType', moduleUrl: CORE, runtime: RenderComponentType};
|
|
|
|
static QueryList: IdentifierSpec = {name: 'QueryList', moduleUrl: CORE, runtime: QueryList};
|
|
|
|
static TemplateRef: IdentifierSpec = {name: 'TemplateRef', moduleUrl: CORE, runtime: TemplateRef};
|
|
|
|
static TemplateRef_:
|
|
|
|
IdentifierSpec = {name: 'ɵTemplateRef_', moduleUrl: CORE, runtime: ɵTemplateRef_};
|
2016-08-24 17:39:49 -07:00
|
|
|
static CodegenComponentFactoryResolver: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵCodegenComponentFactoryResolver',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵCodegenComponentFactoryResolver
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
|
|
|
static ComponentFactoryResolver: IdentifierSpec = {
|
2016-06-22 14:06:23 -07:00
|
|
|
name: 'ComponentFactoryResolver',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2016-06-22 14:06:23 -07:00
|
|
|
runtime: ComponentFactoryResolver
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
2017-02-14 13:33:06 -08:00
|
|
|
static ComponentFactory:
|
|
|
|
IdentifierSpec = {name: 'ComponentFactory', moduleUrl: CORE, runtime: ComponentFactory};
|
2016-11-01 08:21:39 -07:00
|
|
|
static ComponentRef_: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵComponentRef_',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵComponentRef_,
|
|
|
|
};
|
|
|
|
static ComponentRef:
|
|
|
|
IdentifierSpec = {name: 'ComponentRef', moduleUrl: CORE, runtime: ComponentRef};
|
|
|
|
static NgModuleFactory:
|
|
|
|
IdentifierSpec = {name: 'NgModuleFactory', moduleUrl: CORE, runtime: NgModuleFactory};
|
2016-08-24 17:39:49 -07:00
|
|
|
static NgModuleInjector: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵNgModuleInjector',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵNgModuleInjector,
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
2016-09-01 13:46:08 -07:00
|
|
|
static RegisterModuleFactoryFn: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵregisterModuleFactory',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵregisterModuleFactory,
|
2016-09-01 13:46:08 -07:00
|
|
|
};
|
2016-08-29 08:52:25 -07:00
|
|
|
static ValueUnwrapper:
|
2017-02-14 13:33:06 -08:00
|
|
|
IdentifierSpec = {name: 'ɵValueUnwrapper', moduleUrl: CORE, runtime: ɵValueUnwrapper};
|
|
|
|
static Injector: IdentifierSpec = {name: 'Injector', moduleUrl: CORE, runtime: Injector};
|
|
|
|
static ViewEncapsulation:
|
|
|
|
IdentifierSpec = {name: 'ViewEncapsulation', moduleUrl: CORE, runtime: ViewEncapsulation};
|
|
|
|
static ViewType: IdentifierSpec = {name: 'ɵViewType', moduleUrl: CORE, runtime: ɵViewType};
|
2016-08-24 17:39:49 -07:00
|
|
|
static ChangeDetectionStrategy: IdentifierSpec = {
|
2016-01-06 14:13:44 -08:00
|
|
|
name: 'ChangeDetectionStrategy',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2016-08-29 08:52:25 -07:00
|
|
|
runtime: ChangeDetectionStrategy
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
|
|
|
static StaticNodeDebugInfo: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵStaticNodeDebugInfo',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵStaticNodeDebugInfo
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
2017-02-14 13:33:06 -08:00
|
|
|
static DebugContext:
|
|
|
|
IdentifierSpec = {name: 'ɵDebugContext', moduleUrl: CORE, runtime: ɵDebugContext};
|
|
|
|
static Renderer: IdentifierSpec = {name: 'Renderer', moduleUrl: CORE, runtime: Renderer};
|
2016-08-24 17:39:49 -07:00
|
|
|
static SimpleChange:
|
2017-02-14 13:33:06 -08:00
|
|
|
IdentifierSpec = {name: 'SimpleChange', moduleUrl: CORE, runtime: SimpleChange};
|
2016-08-24 17:39:49 -07:00
|
|
|
static ChangeDetectorStatus: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵChangeDetectorStatus',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵChangeDetectorStatus
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
2017-01-27 17:39:48 -08:00
|
|
|
static checkBinding:
|
|
|
|
IdentifierSpec = {name: 'ɵcheckBinding', moduleUrl: CORE, runtime: ɵcheckBinding};
|
|
|
|
static checkBindingChange:
|
|
|
|
IdentifierSpec = {name: 'ɵcheckBindingChange', moduleUrl: CORE, runtime: ɵcheckBindingChange};
|
|
|
|
static checkRenderText:
|
|
|
|
IdentifierSpec = {name: 'ɵcheckRenderText', moduleUrl: CORE, runtime: ɵcheckRenderText};
|
refactor(compiler): generate less code for bindings to DOM elements
Detailed changes:
- remove `UNINITIALIZED`, initialize change detection fields with `undefined`.
* we use `view.numberOfChecks === 0` now everywhere
as indicator whether we are in the first change detection cycle
(previously we used this only in a couple of places).
* we keep the initialization itself as change detection get slower without it.
- remove passing around `throwOnChange` in various generated calls,
and store it on the view as property instead.
- change generated code for bindings to DOM elements as follows:
Before:
```
var currVal_10 = self.context.bgColor;
if (jit_checkBinding15(self.throwOnChange,self._expr_10,currVal_10)) {
self.renderer.setElementStyle(self._el_0,'backgroundColor',((self.viewUtils.sanitizer.sanitize(jit_21,currVal_10) == null)? null: self.viewUtils.sanitizer.sanitize(jit_21,currVal_10).toString()));
self._expr_10 = currVal_10;
}
var currVal_11 = jit_inlineInterpolate16(1,' ',self.context.data.value,' ');
if (jit_checkBinding15(self.throwOnChange,self._expr_11,currVal_11)) {
self.renderer.setText(self._text_1,currVal_11);
self._expr_11 = currVal_11;
}
```,
After:
```
var currVal_10 = self.context.bgColor;
jit_checkRenderStyle14(self,self._el_0,'backgroundColor',null,self._expr_10,self._expr_10=currVal_10,false,jit_21);
var currVal_11 = jit_inlineInterpolate15(1,' ',self.context.data.value,' ');
jit_checkRenderText16(self,self._text_1,self._expr_11,self._expr_11=currVal_11,false);
```
Performance impact:
- None seen (checked against internal latency lab)
Part of #13651
2016-12-29 15:03:55 -08:00
|
|
|
static checkRenderProperty: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵcheckRenderProperty',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵcheckRenderProperty
|
refactor(compiler): generate less code for bindings to DOM elements
Detailed changes:
- remove `UNINITIALIZED`, initialize change detection fields with `undefined`.
* we use `view.numberOfChecks === 0` now everywhere
as indicator whether we are in the first change detection cycle
(previously we used this only in a couple of places).
* we keep the initialization itself as change detection get slower without it.
- remove passing around `throwOnChange` in various generated calls,
and store it on the view as property instead.
- change generated code for bindings to DOM elements as follows:
Before:
```
var currVal_10 = self.context.bgColor;
if (jit_checkBinding15(self.throwOnChange,self._expr_10,currVal_10)) {
self.renderer.setElementStyle(self._el_0,'backgroundColor',((self.viewUtils.sanitizer.sanitize(jit_21,currVal_10) == null)? null: self.viewUtils.sanitizer.sanitize(jit_21,currVal_10).toString()));
self._expr_10 = currVal_10;
}
var currVal_11 = jit_inlineInterpolate16(1,' ',self.context.data.value,' ');
if (jit_checkBinding15(self.throwOnChange,self._expr_11,currVal_11)) {
self.renderer.setText(self._text_1,currVal_11);
self._expr_11 = currVal_11;
}
```,
After:
```
var currVal_10 = self.context.bgColor;
jit_checkRenderStyle14(self,self._el_0,'backgroundColor',null,self._expr_10,self._expr_10=currVal_10,false,jit_21);
var currVal_11 = jit_inlineInterpolate15(1,' ',self.context.data.value,' ');
jit_checkRenderText16(self,self._text_1,self._expr_11,self._expr_11=currVal_11,false);
```
Performance impact:
- None seen (checked against internal latency lab)
Part of #13651
2016-12-29 15:03:55 -08:00
|
|
|
};
|
|
|
|
static checkRenderAttribute: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵcheckRenderAttribute',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵcheckRenderAttribute
|
refactor(compiler): generate less code for bindings to DOM elements
Detailed changes:
- remove `UNINITIALIZED`, initialize change detection fields with `undefined`.
* we use `view.numberOfChecks === 0` now everywhere
as indicator whether we are in the first change detection cycle
(previously we used this only in a couple of places).
* we keep the initialization itself as change detection get slower without it.
- remove passing around `throwOnChange` in various generated calls,
and store it on the view as property instead.
- change generated code for bindings to DOM elements as follows:
Before:
```
var currVal_10 = self.context.bgColor;
if (jit_checkBinding15(self.throwOnChange,self._expr_10,currVal_10)) {
self.renderer.setElementStyle(self._el_0,'backgroundColor',((self.viewUtils.sanitizer.sanitize(jit_21,currVal_10) == null)? null: self.viewUtils.sanitizer.sanitize(jit_21,currVal_10).toString()));
self._expr_10 = currVal_10;
}
var currVal_11 = jit_inlineInterpolate16(1,' ',self.context.data.value,' ');
if (jit_checkBinding15(self.throwOnChange,self._expr_11,currVal_11)) {
self.renderer.setText(self._text_1,currVal_11);
self._expr_11 = currVal_11;
}
```,
After:
```
var currVal_10 = self.context.bgColor;
jit_checkRenderStyle14(self,self._el_0,'backgroundColor',null,self._expr_10,self._expr_10=currVal_10,false,jit_21);
var currVal_11 = jit_inlineInterpolate15(1,' ',self.context.data.value,' ');
jit_checkRenderText16(self,self._text_1,self._expr_11,self._expr_11=currVal_11,false);
```
Performance impact:
- None seen (checked against internal latency lab)
Part of #13651
2016-12-29 15:03:55 -08:00
|
|
|
};
|
2017-01-27 17:39:48 -08:00
|
|
|
static checkRenderClass:
|
|
|
|
IdentifierSpec = {name: 'ɵcheckRenderClass', moduleUrl: CORE, runtime: ɵcheckRenderClass};
|
|
|
|
static checkRenderStyle:
|
|
|
|
IdentifierSpec = {name: 'ɵcheckRenderStyle', moduleUrl: CORE, runtime: ɵcheckRenderStyle};
|
2016-08-24 17:39:49 -07:00
|
|
|
static devModeEqual:
|
2017-02-14 13:33:06 -08:00
|
|
|
IdentifierSpec = {name: 'ɵdevModeEqual', moduleUrl: CORE, runtime: ɵdevModeEqual};
|
2017-01-27 17:39:48 -08:00
|
|
|
static inlineInterpolate:
|
|
|
|
IdentifierSpec = {name: 'ɵinlineInterpolate', moduleUrl: CORE, runtime: ɵinlineInterpolate};
|
|
|
|
static interpolate:
|
|
|
|
IdentifierSpec = {name: 'ɵinterpolate', moduleUrl: CORE, runtime: ɵinterpolate};
|
|
|
|
static castByValue:
|
|
|
|
IdentifierSpec = {name: 'ɵcastByValue', moduleUrl: CORE, runtime: ɵcastByValue};
|
|
|
|
static EMPTY_ARRAY:
|
|
|
|
IdentifierSpec = {name: 'ɵEMPTY_ARRAY', moduleUrl: CORE, runtime: ɵEMPTY_ARRAY};
|
|
|
|
static EMPTY_MAP: IdentifierSpec = {name: 'ɵEMPTY_MAP', moduleUrl: CORE, runtime: ɵEMPTY_MAP};
|
2016-10-19 09:17:36 -07:00
|
|
|
static createRenderElement: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵcreateRenderElement',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵcreateRenderElement
|
2016-10-19 09:17:36 -07:00
|
|
|
};
|
|
|
|
static selectOrCreateRenderHostElement: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵselectOrCreateRenderHostElement',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵselectOrCreateRenderHostElement
|
2016-10-19 09:17:36 -07:00
|
|
|
};
|
|
|
|
static pureProxies: IdentifierSpec[] = [
|
2016-04-22 15:33:32 -07:00
|
|
|
null,
|
2017-01-27 17:39:48 -08:00
|
|
|
{name: 'ɵpureProxy1', moduleUrl: CORE, runtime: ɵpureProxy1},
|
|
|
|
{name: 'ɵpureProxy2', moduleUrl: CORE, runtime: ɵpureProxy2},
|
|
|
|
{name: 'ɵpureProxy3', moduleUrl: CORE, runtime: ɵpureProxy3},
|
|
|
|
{name: 'ɵpureProxy4', moduleUrl: CORE, runtime: ɵpureProxy4},
|
|
|
|
{name: 'ɵpureProxy5', moduleUrl: CORE, runtime: ɵpureProxy5},
|
|
|
|
{name: 'ɵpureProxy6', moduleUrl: CORE, runtime: ɵpureProxy6},
|
|
|
|
{name: 'ɵpureProxy7', moduleUrl: CORE, runtime: ɵpureProxy7},
|
|
|
|
{name: 'ɵpureProxy8', moduleUrl: CORE, runtime: ɵpureProxy8},
|
|
|
|
{name: 'ɵpureProxy9', moduleUrl: CORE, runtime: ɵpureProxy9},
|
|
|
|
{name: 'ɵpureProxy10', moduleUrl: CORE, runtime: ɵpureProxy10},
|
2016-04-22 15:33:32 -07:00
|
|
|
];
|
2016-08-24 17:39:49 -07:00
|
|
|
static SecurityContext: IdentifierSpec = {
|
feat: security implementation in Angular 2.
Summary:
This adds basic security hooks to Angular 2.
* `SecurityContext` is a private API between core, compiler, and
platform-browser. `SecurityContext` communicates what context a value is used
in across template parser, compiler, and sanitization at runtime.
* `SanitizationService` is the bare bones interface to sanitize values for a
particular context.
* `SchemaElementRegistry.securityContext(tagName, attributeOrPropertyName)`
determines the security context for an attribute or property (it turns out
attributes and properties match for the purposes of sanitization).
Based on these hooks:
* `DomSchemaElementRegistry` decides what sanitization applies in a particular
context.
* `DomSanitizationService` implements `SanitizationService` and adds *Safe
Value*s, i.e. the ability to mark a value as safe and not requiring further
sanitization.
* `url_sanitizer` and `style_sanitizer` sanitize URLs and Styles, respectively
(surprise!).
`DomSanitizationService` is the default implementation bound for browser
applications, in the three contexts (browser rendering, web worker rendering,
server side rendering).
BREAKING CHANGES:
*** SECURITY WARNING ***
Angular 2 Release Candidates do not implement proper contextual escaping yet.
Make sure to correctly escape all values that go into the DOM.
*** SECURITY WARNING ***
Reviewers: IgorMinar
Differential Revision: https://reviews.angular.io/D103
2016-04-29 16:04:08 -07:00
|
|
|
name: 'SecurityContext',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
feat: security implementation in Angular 2.
Summary:
This adds basic security hooks to Angular 2.
* `SecurityContext` is a private API between core, compiler, and
platform-browser. `SecurityContext` communicates what context a value is used
in across template parser, compiler, and sanitization at runtime.
* `SanitizationService` is the bare bones interface to sanitize values for a
particular context.
* `SchemaElementRegistry.securityContext(tagName, attributeOrPropertyName)`
determines the security context for an attribute or property (it turns out
attributes and properties match for the purposes of sanitization).
Based on these hooks:
* `DomSchemaElementRegistry` decides what sanitization applies in a particular
context.
* `DomSanitizationService` implements `SanitizationService` and adds *Safe
Value*s, i.e. the ability to mark a value as safe and not requiring further
sanitization.
* `url_sanitizer` and `style_sanitizer` sanitize URLs and Styles, respectively
(surprise!).
`DomSanitizationService` is the default implementation bound for browser
applications, in the three contexts (browser rendering, web worker rendering,
server side rendering).
BREAKING CHANGES:
*** SECURITY WARNING ***
Angular 2 Release Candidates do not implement proper contextual escaping yet.
Make sure to correctly escape all values that go into the DOM.
*** SECURITY WARNING ***
Reviewers: IgorMinar
Differential Revision: https://reviews.angular.io/D103
2016-04-29 16:04:08 -07:00
|
|
|
runtime: SecurityContext,
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
2017-02-14 13:33:06 -08:00
|
|
|
static AnimationKeyframe:
|
|
|
|
IdentifierSpec = {name: 'ɵAnimationKeyframe', moduleUrl: CORE, runtime: ɵAnimationKeyframe};
|
|
|
|
static AnimationStyles:
|
|
|
|
IdentifierSpec = {name: 'ɵAnimationStyles', moduleUrl: CORE, runtime: ɵAnimationStyles};
|
2016-08-24 17:39:49 -07:00
|
|
|
static NoOpAnimationPlayer: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵNoOpAnimationPlayer',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵNoOpAnimationPlayer
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
|
|
|
static AnimationGroupPlayer: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵAnimationGroupPlayer',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵAnimationGroupPlayer
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
|
|
|
static AnimationSequencePlayer: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵAnimationSequencePlayer',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵAnimationSequencePlayer
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
|
|
|
static prepareFinalAnimationStyles: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵprepareFinalAnimationStyles',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵprepareFinalAnimationStyles
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
|
|
|
static balanceAnimationKeyframes: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵbalanceAnimationKeyframes',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵbalanceAnimationKeyframes
|
|
|
|
};
|
|
|
|
static clearStyles:
|
|
|
|
IdentifierSpec = {name: 'ɵclearStyles', moduleUrl: CORE, runtime: ɵclearStyles};
|
|
|
|
static renderStyles:
|
|
|
|
IdentifierSpec = {name: 'ɵrenderStyles', moduleUrl: CORE, runtime: ɵrenderStyles};
|
2016-08-24 17:39:49 -07:00
|
|
|
static collectAndResolveStyles: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵcollectAndResolveStyles',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵcollectAndResolveStyles
|
2016-10-13 16:34:37 -07:00
|
|
|
};
|
2017-02-14 13:33:06 -08:00
|
|
|
static LOCALE_ID: IdentifierSpec = {name: 'LOCALE_ID', moduleUrl: CORE, runtime: LOCALE_ID};
|
|
|
|
static TRANSLATIONS_FORMAT:
|
|
|
|
IdentifierSpec = {name: 'TRANSLATIONS_FORMAT', moduleUrl: CORE, runtime: TRANSLATIONS_FORMAT};
|
2016-10-13 16:34:37 -07:00
|
|
|
static setBindingDebugInfo: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵsetBindingDebugInfo',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵsetBindingDebugInfo
|
2016-10-13 16:34:37 -07:00
|
|
|
};
|
|
|
|
static setBindingDebugInfoForChanges: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵsetBindingDebugInfoForChanges',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵsetBindingDebugInfoForChanges
|
2016-08-24 17:39:49 -07:00
|
|
|
};
|
2016-10-18 17:16:51 -07:00
|
|
|
static AnimationTransition: IdentifierSpec = {
|
2017-02-14 13:33:06 -08:00
|
|
|
name: 'ɵAnimationTransition',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
runtime: ɵAnimationTransition
|
2016-10-12 11:24:54 -07:00
|
|
|
};
|
2016-10-19 09:17:36 -07:00
|
|
|
|
|
|
|
// This is just the interface!
|
2016-10-24 11:11:31 -07:00
|
|
|
static InlineArray:
|
|
|
|
IdentifierSpec = {name: 'InlineArray', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: null};
|
|
|
|
static inlineArrays: IdentifierSpec[] = [
|
2017-01-27 17:39:48 -08:00
|
|
|
{name: 'ɵInlineArray2', moduleUrl: CORE, runtime: ɵInlineArray2},
|
|
|
|
{name: 'ɵInlineArray2', moduleUrl: CORE, runtime: ɵInlineArray2},
|
|
|
|
{name: 'ɵInlineArray4', moduleUrl: CORE, runtime: ɵInlineArray4},
|
|
|
|
{name: 'ɵInlineArray8', moduleUrl: CORE, runtime: ɵInlineArray8},
|
|
|
|
{name: 'ɵInlineArray16', moduleUrl: CORE, runtime: ɵInlineArray16},
|
2016-10-19 09:17:36 -07:00
|
|
|
];
|
2017-01-27 17:39:48 -08:00
|
|
|
static EMPTY_INLINE_ARRAY:
|
|
|
|
IdentifierSpec = {name: 'ɵEMPTY_INLINE_ARRAY', moduleUrl: CORE, runtime: ɵEMPTY_INLINE_ARRAY};
|
|
|
|
static InlineArrayDynamic:
|
|
|
|
IdentifierSpec = {name: 'ɵInlineArrayDynamic', moduleUrl: CORE, runtime: ɵInlineArrayDynamic};
|
2016-10-26 16:58:35 -07:00
|
|
|
static subscribeToRenderElement: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵsubscribeToRenderElement',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵsubscribeToRenderElement
|
2016-10-26 16:58:35 -07:00
|
|
|
};
|
2016-11-02 08:11:10 -07:00
|
|
|
static createRenderComponentType: IdentifierSpec = {
|
2017-01-27 17:39:48 -08:00
|
|
|
name: 'ɵcreateRenderComponentType',
|
2017-02-14 13:33:06 -08:00
|
|
|
moduleUrl: CORE,
|
2017-01-27 17:39:48 -08:00
|
|
|
runtime: ɵcreateRenderComponentType
|
2016-11-02 08:11:10 -07:00
|
|
|
};
|
2017-02-02 15:01:35 -08:00
|
|
|
|
2017-02-14 13:33:06 -08:00
|
|
|
|
2017-01-27 17:39:48 -08:00
|
|
|
static noop: IdentifierSpec = {name: 'ɵnoop', moduleUrl: CORE, runtime: ɵnoop};
|
2017-02-14 13:33:06 -08:00
|
|
|
|
2017-02-27 13:28:41 -08:00
|
|
|
static viewDef: IdentifierSpec = {name: 'ɵvid', moduleUrl: CORE, runtime: ɵvid};
|
|
|
|
static elementDef: IdentifierSpec = {name: 'ɵeld', moduleUrl: CORE, runtime: ɵeld};
|
|
|
|
static anchorDef: IdentifierSpec = {name: 'ɵand', moduleUrl: CORE, runtime: ɵand};
|
|
|
|
static textDef: IdentifierSpec = {name: 'ɵted', moduleUrl: CORE, runtime: ɵted};
|
|
|
|
static directiveDef: IdentifierSpec = {name: 'ɵdid', moduleUrl: CORE, runtime: ɵdid};
|
|
|
|
static providerDef: IdentifierSpec = {name: 'ɵprd', moduleUrl: CORE, runtime: ɵprd};
|
|
|
|
static queryDef: IdentifierSpec = {name: 'ɵqud', moduleUrl: CORE, runtime: ɵqud};
|
|
|
|
static pureArrayDef: IdentifierSpec = {name: 'ɵpad', moduleUrl: CORE, runtime: ɵpad};
|
|
|
|
static pureObjectDef: IdentifierSpec = {name: 'ɵpod', moduleUrl: CORE, runtime: ɵpod};
|
|
|
|
static purePipeDef: IdentifierSpec = {name: 'ɵppd', moduleUrl: CORE, runtime: ɵppd};
|
|
|
|
static pipeDef: IdentifierSpec = {name: 'ɵpid', moduleUrl: CORE, runtime: ɵpid};
|
|
|
|
static nodeValue: IdentifierSpec = {name: 'ɵnov', moduleUrl: CORE, runtime: ɵnov};
|
|
|
|
static ngContentDef: IdentifierSpec = {name: 'ɵncd', moduleUrl: CORE, runtime: ɵncd};
|
|
|
|
static unwrapValue: IdentifierSpec = {name: 'ɵunv', moduleUrl: CORE, runtime: ɵunv};
|
|
|
|
static createRendererTypeV2: IdentifierSpec = {name: 'ɵcrt', moduleUrl: CORE, runtime: ɵcrt};
|
2017-02-17 08:56:49 -08:00
|
|
|
static RendererTypeV2: IdentifierSpec = {
|
|
|
|
name: 'RendererTypeV2',
|
|
|
|
moduleUrl: CORE,
|
|
|
|
// type only
|
|
|
|
runtime: null
|
|
|
|
};
|
|
|
|
static ViewDefinition: IdentifierSpec = {
|
2017-02-18 21:28:27 -08:00
|
|
|
name: 'ɵViewDefinition',
|
2017-02-17 08:56:49 -08:00
|
|
|
moduleUrl: CORE,
|
|
|
|
// type only
|
|
|
|
runtime: null
|
|
|
|
};
|
2017-02-27 13:28:41 -08:00
|
|
|
static createComponentFactory: IdentifierSpec = {name: 'ɵccf', moduleUrl: CORE, runtime: ɵccf};
|
2016-10-19 09:17:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export function assetUrl(pkg: string, path: string = null, type: string = 'src'): string {
|
|
|
|
if (path == null) {
|
2017-02-14 13:33:06 -08:00
|
|
|
return `@angular/${pkg}`;
|
2016-10-19 09:17:36 -07:00
|
|
|
} else {
|
2016-11-15 10:14:01 -08:00
|
|
|
return `@angular/${pkg}/${type}/${path}`;
|
2016-10-19 09:17:36 -07:00
|
|
|
}
|
2016-08-24 17:39:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export function resolveIdentifier(identifier: IdentifierSpec) {
|
2017-02-14 13:33:06 -08:00
|
|
|
let name = identifier.name;
|
2017-01-27 17:39:48 -08:00
|
|
|
return ɵreflector.resolveIdentifier(name, identifier.moduleUrl, null, identifier.runtime);
|
2016-11-23 09:42:19 -08:00
|
|
|
}
|
|
|
|
|
2016-11-30 10:52:51 -08:00
|
|
|
export function createIdentifier(identifier: IdentifierSpec): CompileIdentifierMetadata {
|
2017-02-14 13:33:06 -08:00
|
|
|
return {reference: resolveIdentifier(identifier)};
|
2016-01-06 14:13:44 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function identifierToken(identifier: CompileIdentifierMetadata): CompileTokenMetadata {
|
2016-11-30 10:52:51 -08:00
|
|
|
return {identifier: identifier};
|
2016-01-06 14:13:44 -08:00
|
|
|
}
|
2016-08-24 17:39:49 -07:00
|
|
|
|
2016-11-23 09:42:19 -08:00
|
|
|
export function createIdentifierToken(identifier: IdentifierSpec): CompileTokenMetadata {
|
|
|
|
return identifierToken(createIdentifier(identifier));
|
2016-08-24 17:39:49 -07:00
|
|
|
}
|
|
|
|
|
2016-11-23 09:42:19 -08:00
|
|
|
export function createEnumIdentifier(
|
|
|
|
enumType: IdentifierSpec, name: string): CompileIdentifierMetadata {
|
2017-02-14 13:33:06 -08:00
|
|
|
const resolvedEnum = ɵreflector.resolveEnum(resolveIdentifier(enumType), name);
|
2016-11-30 10:52:51 -08:00
|
|
|
return {reference: resolvedEnum};
|
2016-08-30 18:07:40 -07:00
|
|
|
}
|