2016-06-23 12:47:54 -04: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
|
|
|
|
*/
|
|
|
|
|
2016-11-01 11:21:39 -04:00
|
|
|
import {ANALYZE_FOR_ENTRY_COMPONENTS, AnimationTransitionEvent, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ComponentRef, ElementRef, Injector, LOCALE_ID, NgModuleFactory, QueryList, RenderComponentType, Renderer, SecurityContext, SimpleChange, TRANSLATIONS_FORMAT, TemplateRef, ViewContainerRef, ViewEncapsulation} from '@angular/core';
|
2016-08-22 20:18:25 -04:00
|
|
|
|
2016-11-15 13:14:01 -05:00
|
|
|
import {StaticSymbol, isStaticSymbol} from './aot/static_symbol';
|
2016-04-28 20:50:03 -04:00
|
|
|
import {CompileIdentifierMetadata, CompileTokenMetadata} from './compile_metadata';
|
2016-11-01 14:12:25 -04:00
|
|
|
import {AnimationGroupPlayer, AnimationKeyframe, AnimationSequencePlayer, AnimationStyles, AnimationTransition, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, ComponentRef_, DebugAppView, DebugContext, NgModuleInjector, NoOpAnimationPlayer, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewContainer, ViewType, balanceAnimationKeyframes, clearStyles, collectAndResolveStyles, devModeEqual, prepareFinalAnimationStyles, reflector, registerModuleFactory, renderStyles, view_utils} from './private_import_core';
|
2016-01-06 17:13:44 -05:00
|
|
|
|
2016-11-12 08:08:58 -05:00
|
|
|
const APP_VIEW_MODULE_URL = assetUrl('core', 'linker/view');
|
|
|
|
const VIEW_UTILS_MODULE_URL = assetUrl('core', 'linker/view_utils');
|
|
|
|
const CD_MODULE_URL = assetUrl('core', 'change_detection/change_detection');
|
2016-01-06 17:13:44 -05:00
|
|
|
|
2016-11-12 08:08:58 -05:00
|
|
|
const ANIMATION_STYLE_UTIL_ASSET_URL = assetUrl('core', 'animation/animation_style_util');
|
2016-01-06 17:13:44 -05:00
|
|
|
|
2016-08-24 20:39:49 -04:00
|
|
|
export interface IdentifierSpec {
|
|
|
|
name: string;
|
|
|
|
moduleUrl: string;
|
|
|
|
runtime: any;
|
|
|
|
}
|
|
|
|
|
2016-01-06 17:13:44 -05:00
|
|
|
export class Identifiers {
|
2016-08-24 20:39:49 -04:00
|
|
|
static ANALYZE_FOR_ENTRY_COMPONENTS: IdentifierSpec = {
|
2016-07-25 03:36:30 -04:00
|
|
|
name: 'ANALYZE_FOR_ENTRY_COMPONENTS',
|
2016-07-07 13:05:55 -04:00
|
|
|
moduleUrl: assetUrl('core', 'metadata/di'),
|
2016-07-25 03:36:30 -04:00
|
|
|
runtime: ANALYZE_FOR_ENTRY_COMPONENTS
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ViewUtils: IdentifierSpec = {
|
|
|
|
name: 'ViewUtils',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/view_utils'),
|
2016-10-13 19:34:37 -04:00
|
|
|
runtime: view_utils.ViewUtils
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AppView:
|
2016-08-29 11:52:25 -04:00
|
|
|
IdentifierSpec = {name: 'AppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: AppView};
|
2016-08-24 20:39:49 -04:00
|
|
|
static DebugAppView: IdentifierSpec = {
|
|
|
|
name: 'DebugAppView',
|
|
|
|
moduleUrl: APP_VIEW_MODULE_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: DebugAppView
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
2016-11-01 14:12:25 -04:00
|
|
|
static ViewContainer: IdentifierSpec = {
|
|
|
|
name: 'ViewContainer',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/view_container'),
|
|
|
|
runtime: ViewContainer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ElementRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ElementRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/element_ref'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: ElementRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ViewContainerRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ViewContainerRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/view_container_ref'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: ViewContainerRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ChangeDetectorRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ChangeDetectorRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'change_detection/change_detector_ref'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: ChangeDetectorRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static RenderComponentType: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'RenderComponentType',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'render/api'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: RenderComponentType
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static QueryList: IdentifierSpec = {
|
|
|
|
name: 'QueryList',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/query_list'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: QueryList
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static TemplateRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'TemplateRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/template_ref'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: TemplateRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static TemplateRef_: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'TemplateRef_',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/template_ref'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: TemplateRef_
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static CodegenComponentFactoryResolver: IdentifierSpec = {
|
2016-06-22 17:06:23 -04:00
|
|
|
name: 'CodegenComponentFactoryResolver',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory_resolver'),
|
|
|
|
runtime: CodegenComponentFactoryResolver
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ComponentFactoryResolver: IdentifierSpec = {
|
2016-06-22 17:06:23 -04:00
|
|
|
name: 'ComponentFactoryResolver',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory_resolver'),
|
|
|
|
runtime: ComponentFactoryResolver
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ComponentFactory: IdentifierSpec = {
|
2016-06-28 12:54:42 -04:00
|
|
|
name: 'ComponentFactory',
|
|
|
|
runtime: ComponentFactory,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory')
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
2016-11-01 11:21:39 -04:00
|
|
|
static ComponentRef_: IdentifierSpec = {
|
|
|
|
name: 'ComponentRef_',
|
|
|
|
runtime: ComponentRef_,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory')
|
|
|
|
};
|
|
|
|
static ComponentRef: IdentifierSpec = {
|
|
|
|
name: 'ComponentRef',
|
|
|
|
runtime: ComponentRef,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory')
|
|
|
|
};
|
2016-08-24 20:39:49 -04:00
|
|
|
static NgModuleFactory: IdentifierSpec = {
|
2016-07-18 06:50:31 -04:00
|
|
|
name: 'NgModuleFactory',
|
|
|
|
runtime: NgModuleFactory,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/ng_module_factory')
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static NgModuleInjector: IdentifierSpec = {
|
2016-07-18 06:50:31 -04:00
|
|
|
name: 'NgModuleInjector',
|
|
|
|
runtime: NgModuleInjector,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/ng_module_factory')
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
2016-09-01 16:46:08 -04:00
|
|
|
static RegisterModuleFactoryFn: IdentifierSpec = {
|
|
|
|
name: 'registerModuleFactory',
|
|
|
|
runtime: registerModuleFactory,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/ng_module_factory_loader')
|
|
|
|
};
|
2016-08-29 11:52:25 -04:00
|
|
|
static ValueUnwrapper:
|
|
|
|
IdentifierSpec = {name: 'ValueUnwrapper', moduleUrl: CD_MODULE_URL, runtime: ValueUnwrapper};
|
2016-08-24 20:39:49 -04:00
|
|
|
static Injector: IdentifierSpec = {
|
|
|
|
name: 'Injector',
|
|
|
|
moduleUrl: assetUrl('core', 'di/injector'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: Injector
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ViewEncapsulation: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ViewEncapsulation',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'metadata/view'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: ViewEncapsulation
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ViewType: IdentifierSpec = {
|
|
|
|
name: 'ViewType',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/view_type'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: ViewType
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ChangeDetectionStrategy: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ChangeDetectionStrategy',
|
|
|
|
moduleUrl: CD_MODULE_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: ChangeDetectionStrategy
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static StaticNodeDebugInfo: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'StaticNodeDebugInfo',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/debug_context'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: StaticNodeDebugInfo
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static DebugContext: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'DebugContext',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/debug_context'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: DebugContext
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static Renderer: IdentifierSpec = {
|
|
|
|
name: 'Renderer',
|
|
|
|
moduleUrl: assetUrl('core', 'render/api'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: Renderer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static SimpleChange:
|
2016-08-29 11:52:25 -04:00
|
|
|
IdentifierSpec = {name: 'SimpleChange', moduleUrl: CD_MODULE_URL, runtime: SimpleChange};
|
2016-08-24 20:39:49 -04:00
|
|
|
static UNINITIALIZED:
|
2016-08-29 11:52:25 -04:00
|
|
|
IdentifierSpec = {name: 'UNINITIALIZED', moduleUrl: CD_MODULE_URL, runtime: UNINITIALIZED};
|
2016-08-24 20:39:49 -04:00
|
|
|
static ChangeDetectorStatus: IdentifierSpec = {
|
|
|
|
name: 'ChangeDetectorStatus',
|
|
|
|
moduleUrl: CD_MODULE_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: ChangeDetectorStatus
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static checkBinding: IdentifierSpec = {
|
|
|
|
name: 'checkBinding',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-10-13 19:34:37 -04:00
|
|
|
runtime: view_utils.checkBinding
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static devModeEqual:
|
2016-08-29 11:52:25 -04:00
|
|
|
IdentifierSpec = {name: 'devModeEqual', moduleUrl: CD_MODULE_URL, runtime: devModeEqual};
|
2016-11-07 15:23:03 -05:00
|
|
|
static inlineInterpolate: IdentifierSpec = {
|
|
|
|
name: 'inlineInterpolate',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.inlineInterpolate
|
|
|
|
};
|
2016-08-24 20:39:49 -04:00
|
|
|
static interpolate: IdentifierSpec = {
|
|
|
|
name: 'interpolate',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-10-13 19:34:37 -04:00
|
|
|
runtime: view_utils.interpolate
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static castByValue: IdentifierSpec = {
|
|
|
|
name: 'castByValue',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-10-13 19:34:37 -04:00
|
|
|
runtime: view_utils.castByValue
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static EMPTY_ARRAY: IdentifierSpec = {
|
|
|
|
name: 'EMPTY_ARRAY',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-10-13 19:34:37 -04:00
|
|
|
runtime: view_utils.EMPTY_ARRAY
|
|
|
|
};
|
|
|
|
static EMPTY_MAP: IdentifierSpec = {
|
|
|
|
name: 'EMPTY_MAP',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.EMPTY_MAP
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
2016-10-19 12:17:36 -04:00
|
|
|
static createRenderElement: IdentifierSpec = {
|
|
|
|
name: 'createRenderElement',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.createRenderElement
|
|
|
|
};
|
|
|
|
static selectOrCreateRenderHostElement: IdentifierSpec = {
|
|
|
|
name: 'selectOrCreateRenderHostElement',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.selectOrCreateRenderHostElement
|
|
|
|
};
|
|
|
|
static pureProxies: IdentifierSpec[] = [
|
2016-04-22 18:33:32 -04:00
|
|
|
null,
|
2016-10-13 19:34:37 -04:00
|
|
|
{name: 'pureProxy1', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy1},
|
|
|
|
{name: 'pureProxy2', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy2},
|
|
|
|
{name: 'pureProxy3', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy3},
|
|
|
|
{name: 'pureProxy4', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy4},
|
|
|
|
{name: 'pureProxy5', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy5},
|
|
|
|
{name: 'pureProxy6', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy6},
|
|
|
|
{name: 'pureProxy7', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy7},
|
|
|
|
{name: 'pureProxy8', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy8},
|
|
|
|
{name: 'pureProxy9', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy9},
|
|
|
|
{name: 'pureProxy10', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.pureProxy10},
|
2016-04-22 18:33:32 -04:00
|
|
|
];
|
2016-08-24 20:39:49 -04: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 19:04:08 -04:00
|
|
|
name: 'SecurityContext',
|
|
|
|
moduleUrl: assetUrl('core', 'security'),
|
|
|
|
runtime: SecurityContext,
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationKeyframe: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationKeyframe',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_keyframe'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: AnimationKeyframe
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationStyles: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationStyles',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_styles'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: AnimationStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static NoOpAnimationPlayer: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'NoOpAnimationPlayer',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_player'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: NoOpAnimationPlayer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationGroupPlayer: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationGroupPlayer',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_group_player'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: AnimationGroupPlayer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationSequencePlayer: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationSequencePlayer',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_sequence_player'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: AnimationSequencePlayer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static prepareFinalAnimationStyles: IdentifierSpec = {
|
2016-06-03 21:27:34 -04:00
|
|
|
name: 'prepareFinalAnimationStyles',
|
2016-05-25 15:46:22 -04:00
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: prepareFinalAnimationStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static balanceAnimationKeyframes: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'balanceAnimationKeyframes',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: balanceAnimationKeyframes
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static clearStyles: IdentifierSpec = {
|
|
|
|
name: 'clearStyles',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: clearStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static renderStyles: IdentifierSpec = {
|
|
|
|
name: 'renderStyles',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: renderStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static collectAndResolveStyles: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'collectAndResolveStyles',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: collectAndResolveStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static LOCALE_ID: IdentifierSpec = {
|
|
|
|
name: 'LOCALE_ID',
|
|
|
|
moduleUrl: assetUrl('core', 'i18n/tokens'),
|
2016-10-13 19:34:37 -04:00
|
|
|
runtime: LOCALE_ID
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static TRANSLATIONS_FORMAT: IdentifierSpec = {
|
2016-08-12 17:45:36 -04:00
|
|
|
name: 'TRANSLATIONS_FORMAT',
|
|
|
|
moduleUrl: assetUrl('core', 'i18n/tokens'),
|
2016-10-13 19:34:37 -04:00
|
|
|
runtime: TRANSLATIONS_FORMAT
|
|
|
|
};
|
|
|
|
static setBindingDebugInfo: IdentifierSpec = {
|
|
|
|
name: 'setBindingDebugInfo',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.setBindingDebugInfo
|
|
|
|
};
|
|
|
|
static setBindingDebugInfoForChanges: IdentifierSpec = {
|
|
|
|
name: 'setBindingDebugInfoForChanges',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.setBindingDebugInfoForChanges
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
2016-10-18 20:16:51 -04:00
|
|
|
static AnimationTransition: IdentifierSpec = {
|
|
|
|
name: 'AnimationTransition',
|
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_transition'),
|
|
|
|
runtime: AnimationTransition
|
2016-10-12 14:24:54 -04:00
|
|
|
};
|
2016-10-19 12:17:36 -04:00
|
|
|
|
|
|
|
// This is just the interface!
|
2016-10-24 14:11:31 -04:00
|
|
|
static InlineArray:
|
|
|
|
IdentifierSpec = {name: 'InlineArray', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: null};
|
|
|
|
static inlineArrays: IdentifierSpec[] = [
|
|
|
|
{name: 'InlineArray2', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.InlineArray2},
|
|
|
|
{name: 'InlineArray2', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.InlineArray2},
|
|
|
|
{name: 'InlineArray4', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.InlineArray4},
|
|
|
|
{name: 'InlineArray8', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.InlineArray8},
|
|
|
|
{name: 'InlineArray16', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.InlineArray16},
|
2016-10-19 12:17:36 -04:00
|
|
|
];
|
2016-10-24 14:11:31 -04:00
|
|
|
static EMPTY_INLINE_ARRAY: IdentifierSpec = {
|
|
|
|
name: 'EMPTY_INLINE_ARRAY',
|
2016-10-19 12:17:36 -04:00
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-10-24 14:11:31 -04:00
|
|
|
runtime: view_utils.EMPTY_INLINE_ARRAY
|
2016-10-19 12:17:36 -04:00
|
|
|
};
|
2016-10-24 14:11:31 -04:00
|
|
|
static InlineArrayDynamic: IdentifierSpec = {
|
|
|
|
name: 'InlineArrayDynamic',
|
2016-10-19 12:17:36 -04:00
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-10-24 14:11:31 -04:00
|
|
|
runtime: view_utils.InlineArrayDynamic
|
2016-10-19 12:17:36 -04:00
|
|
|
};
|
2016-10-26 19:58:35 -04:00
|
|
|
static subscribeToRenderElement: IdentifierSpec = {
|
|
|
|
name: 'subscribeToRenderElement',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.subscribeToRenderElement
|
|
|
|
};
|
2016-11-02 11:11:10 -04:00
|
|
|
static createRenderComponentType: IdentifierSpec = {
|
|
|
|
name: 'createRenderComponentType',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: view_utils.createRenderComponentType
|
|
|
|
};
|
2016-10-26 19:58:35 -04:00
|
|
|
static noop:
|
|
|
|
IdentifierSpec = {name: 'noop', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: view_utils.noop};
|
2016-10-19 12:17:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export function assetUrl(pkg: string, path: string = null, type: string = 'src'): string {
|
|
|
|
if (path == null) {
|
2016-11-15 13:14:01 -05:00
|
|
|
return `@angular/${pkg}/index`;
|
2016-10-19 12:17:36 -04:00
|
|
|
} else {
|
2016-11-15 13:14:01 -05:00
|
|
|
return `@angular/${pkg}/${type}/${path}`;
|
2016-10-19 12:17:36 -04:00
|
|
|
}
|
2016-08-24 20:39:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export function resolveIdentifier(identifier: IdentifierSpec) {
|
2016-11-15 13:14:01 -05:00
|
|
|
let moduleUrl = identifier.moduleUrl;
|
|
|
|
const reference =
|
|
|
|
reflector.resolveIdentifier(identifier.name, identifier.moduleUrl, identifier.runtime);
|
|
|
|
if (isStaticSymbol(reference)) {
|
|
|
|
moduleUrl = reference.filePath;
|
|
|
|
}
|
|
|
|
return new CompileIdentifierMetadata(
|
|
|
|
{name: identifier.name, moduleUrl: moduleUrl, reference: reference});
|
2016-01-06 17:13:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export function identifierToken(identifier: CompileIdentifierMetadata): CompileTokenMetadata {
|
|
|
|
return new CompileTokenMetadata({identifier: identifier});
|
|
|
|
}
|
2016-08-24 20:39:49 -04:00
|
|
|
|
|
|
|
export function resolveIdentifierToken(identifier: IdentifierSpec): CompileTokenMetadata {
|
|
|
|
return identifierToken(resolveIdentifier(identifier));
|
|
|
|
}
|
|
|
|
|
|
|
|
export function resolveEnumIdentifier(
|
|
|
|
enumType: CompileIdentifierMetadata, name: string): CompileIdentifierMetadata {
|
2016-08-29 11:52:25 -04:00
|
|
|
const resolvedEnum = reflector.resolveEnum(enumType.reference, name);
|
|
|
|
return new CompileIdentifierMetadata(
|
|
|
|
{name: `${enumType.name}.${name}`, moduleUrl: enumType.moduleUrl, reference: resolvedEnum});
|
2016-08-30 21:07:40 -04:00
|
|
|
}
|