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-08-12 17:45:36 -04:00
|
|
|
import {ANALYZE_FOR_ENTRY_COMPONENTS, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ElementRef, Injector, LOCALE_ID as LOCALE_ID_, NgModuleFactory, QueryList, RenderComponentType, Renderer, SecurityContext, SimpleChange, TRANSLATIONS_FORMAT as TRANSLATIONS_FORMAT_, TemplateRef, ViewContainerRef, ViewEncapsulation} from '@angular/core';
|
2016-08-22 20:18:25 -04:00
|
|
|
|
2016-08-29 11:52:25 -04:00
|
|
|
import {AnimationGroupPlayer, AnimationKeyframe, AnimationOutput, AnimationSequencePlayer, AnimationStyles, AppElement, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, DebugAppView, DebugContext, EMPTY_ARRAY, EMPTY_MAP, NgModuleInjector, NoOpAnimationPlayer, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewType, ViewUtils, balanceAnimationKeyframes, castByValue, checkBinding, clearStyles, collectAndResolveStyles, devModeEqual, flattenNestedViewRenderNodes, interpolate, prepareFinalAnimationStyles, pureProxy1, pureProxy10, pureProxy2, pureProxy3, pureProxy4, pureProxy5, pureProxy6, pureProxy7, pureProxy8, pureProxy9, reflector, renderStyles} from '../core_private';
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
import {CompileIdentifierMetadata, CompileTokenMetadata} from './compile_metadata';
|
|
|
|
import {assetUrl} from './util';
|
2016-01-06 17:13:44 -05:00
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var APP_VIEW_MODULE_URL = assetUrl('core', 'linker/view');
|
|
|
|
var VIEW_UTILS_MODULE_URL = assetUrl('core', 'linker/view_utils');
|
|
|
|
var CD_MODULE_URL = assetUrl('core', 'change_detection/change_detection');
|
2016-01-06 17:13:44 -05:00
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
var 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-08-29 11:52:25 -04:00
|
|
|
runtime: 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
|
|
|
};
|
|
|
|
static AppElement: IdentifierSpec = {
|
|
|
|
name: 'AppElement',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/element'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: AppElement
|
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
|
|
|
};
|
|
|
|
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-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-08-29 11:52:25 -04:00
|
|
|
runtime: checkBinding
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static flattenNestedViewRenderNodes: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'flattenNestedViewRenderNodes',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: flattenNestedViewRenderNodes
|
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-08-24 20:39:49 -04:00
|
|
|
static interpolate: IdentifierSpec = {
|
|
|
|
name: 'interpolate',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: interpolate
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static castByValue: IdentifierSpec = {
|
|
|
|
name: 'castByValue',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: castByValue
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static EMPTY_ARRAY: IdentifierSpec = {
|
|
|
|
name: 'EMPTY_ARRAY',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: EMPTY_ARRAY
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static EMPTY_MAP:
|
2016-08-29 11:52:25 -04:00
|
|
|
IdentifierSpec = {name: 'EMPTY_MAP', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: EMPTY_MAP};
|
2016-04-29 13:43:26 -04:00
|
|
|
|
2016-04-22 18:33:32 -04:00
|
|
|
static pureProxies = [
|
|
|
|
null,
|
2016-08-24 20:39:49 -04:00
|
|
|
{name: 'pureProxy1', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy1},
|
|
|
|
{name: 'pureProxy2', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy2},
|
|
|
|
{name: 'pureProxy3', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy3},
|
|
|
|
{name: 'pureProxy4', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy4},
|
|
|
|
{name: 'pureProxy5', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy5},
|
|
|
|
{name: 'pureProxy6', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy6},
|
|
|
|
{name: 'pureProxy7', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy7},
|
|
|
|
{name: 'pureProxy8', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy8},
|
|
|
|
{name: 'pureProxy9', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy9},
|
|
|
|
{name: 'pureProxy10', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: 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'),
|
|
|
|
runtime: LOCALE_ID_
|
|
|
|
};
|
|
|
|
static TRANSLATIONS_FORMAT: IdentifierSpec = {
|
2016-08-12 17:45:36 -04:00
|
|
|
name: 'TRANSLATIONS_FORMAT',
|
|
|
|
moduleUrl: assetUrl('core', 'i18n/tokens'),
|
|
|
|
runtime: TRANSLATIONS_FORMAT_
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationOutput: IdentifierSpec = {
|
2016-08-22 20:18:25 -04:00
|
|
|
name: 'AnimationOutput',
|
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_output'),
|
2016-08-29 11:52:25 -04:00
|
|
|
runtime: AnimationOutput
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function resolveIdentifier(identifier: IdentifierSpec) {
|
|
|
|
return new CompileIdentifierMetadata({
|
|
|
|
name: identifier.name,
|
|
|
|
moduleUrl: identifier.moduleUrl,
|
2016-08-29 11:52:25 -04:00
|
|
|
reference:
|
|
|
|
reflector.resolveIdentifier(identifier.name, identifier.moduleUrl, identifier.runtime)
|
2016-08-22 20:18:25 -04:00
|
|
|
});
|
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-24 20:39:49 -04:00
|
|
|
}
|