chore: replace CONST_EXPR with /*@ts2dart_const*/
This commit is contained in:
parent
d2527b504a
commit
a02614beaa
@ -17,6 +17,5 @@ export {ROUTER_PROVIDERS} from './src/alt_router/router_providers';
|
|||||||
|
|
||||||
import {RouterOutlet} from './src/alt_router/directives/router_outlet';
|
import {RouterOutlet} from './src/alt_router/directives/router_outlet';
|
||||||
import {RouterLink} from './src/alt_router/directives/router_link';
|
import {RouterLink} from './src/alt_router/directives/router_link';
|
||||||
import {CONST_EXPR} from './src/facade/lang';
|
|
||||||
|
|
||||||
export const ROUTER_DIRECTIVES: any[] = CONST_EXPR([RouterOutlet, RouterLink]);
|
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/ [RouterOutlet, RouterLink];
|
||||||
|
@ -13,7 +13,7 @@ export {
|
|||||||
disableDebugTools
|
disableDebugTools
|
||||||
} from 'angular2/src/platform/browser_common';
|
} from 'angular2/src/platform/browser_common';
|
||||||
|
|
||||||
import {Type, isPresent, isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {Type, isPresent, isBlank} from 'angular2/src/facade/lang';
|
||||||
import {
|
import {
|
||||||
BROWSER_PROVIDERS,
|
BROWSER_PROVIDERS,
|
||||||
BROWSER_APP_COMMON_PROVIDERS,
|
BROWSER_APP_COMMON_PROVIDERS,
|
||||||
@ -39,10 +39,10 @@ import {Provider} from 'angular2/src/core/di';
|
|||||||
/**
|
/**
|
||||||
* An array of providers that should be passed into `application()` when bootstrapping a component.
|
* An array of providers that should be passed into `application()` when bootstrapping a component.
|
||||||
*/
|
*/
|
||||||
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/ [
|
||||||
BROWSER_APP_COMMON_PROVIDERS,
|
BROWSER_APP_COMMON_PROVIDERS,
|
||||||
COMPILER_PROVIDERS,
|
COMPILER_PROVIDERS,
|
||||||
new Provider(XHR, {useClass: XHRImpl}),
|
new Provider(XHR, {useClass: XHRImpl},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export function browserPlatform(): PlatformRef {
|
export function browserPlatform(): PlatformRef {
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
* have been precompiled offline.
|
* have been precompiled offline.
|
||||||
*/
|
*/
|
||||||
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
BROWSER_APP_COMMON_PROVIDERS;
|
/*@ts2dart_const*/ BROWSER_APP_COMMON_PROVIDERS;
|
||||||
|
|
||||||
export function browserStaticPlatform(): PlatformRef {
|
export function browserStaticPlatform(): PlatformRef {
|
||||||
if (isBlank(getPlatform())) {
|
if (isBlank(getPlatform())) {
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
||||||
} from 'angular2/platform/testing/browser_static';
|
} from 'angular2/platform/testing/browser_static';
|
||||||
import {BROWSER_APP_PROVIDERS} from 'angular2/platform/browser';
|
import {BROWSER_APP_PROVIDERS} from 'angular2/platform/browser';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Providers for using template cache to avoid actual XHR.
|
* Providers for using template cache to avoid actual XHR.
|
||||||
@ -15,10 +14,10 @@ export {CACHED_TEMPLATE_PROVIDER} from 'angular2/platform/browser';
|
|||||||
* Default platform providers for testing.
|
* Default platform providers for testing.
|
||||||
*/
|
*/
|
||||||
export const TEST_BROWSER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const TEST_BROWSER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([TEST_BROWSER_STATIC_PLATFORM_PROVIDERS]);
|
/*@ts2dart_const*/[TEST_BROWSER_STATIC_PLATFORM_PROVIDERS];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default application providers for testing.
|
* Default application providers for testing.
|
||||||
*/
|
*/
|
||||||
export const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([BROWSER_APP_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS]);
|
/*@ts2dart_const*/[BROWSER_APP_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS];
|
||||||
|
@ -30,7 +30,7 @@ import {BrowserDetection} from 'angular2/src/testing/utils';
|
|||||||
|
|
||||||
import {ELEMENT_PROBE_PROVIDERS} from 'angular2/platform/common_dom';
|
import {ELEMENT_PROBE_PROVIDERS} from 'angular2/platform/common_dom';
|
||||||
|
|
||||||
import {CONST_EXPR, IS_DART} from 'angular2/src/facade/lang';
|
import {IS_DART} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
import {Log} from 'angular2/src/testing/utils';
|
import {Log} from 'angular2/src/testing/utils';
|
||||||
|
|
||||||
@ -47,14 +47,14 @@ function createNgZone(): NgZone {
|
|||||||
* Default platform providers for testing without a compiler.
|
* Default platform providers for testing without a compiler.
|
||||||
*/
|
*/
|
||||||
export const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([
|
/*@ts2dart_const*/ [
|
||||||
PLATFORM_COMMON_PROVIDERS,
|
PLATFORM_COMMON_PROVIDERS,
|
||||||
new Provider(PLATFORM_INITIALIZER, {useValue: initBrowserTests, multi: true})
|
new Provider(PLATFORM_INITIALIZER, {useValue: initBrowserTests, multi: true}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([
|
/*@ts2dart_const*/ [
|
||||||
new Provider(APP_ID, {useValue: 'a'}),
|
new Provider(APP_ID, {useValue: 'a'},
|
||||||
ELEMENT_PROBE_PROVIDERS,
|
ELEMENT_PROBE_PROVIDERS,
|
||||||
new Provider(DirectiveResolver, {useClass: MockDirectiveResolver}),
|
new Provider(DirectiveResolver, {useClass: MockDirectiveResolver}),
|
||||||
new Provider(ViewResolver, {useClass: MockViewResolver}),
|
new Provider(ViewResolver, {useClass: MockViewResolver}),
|
||||||
@ -69,8 +69,8 @@ export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array<any /*Type | Provider | an
|
|||||||
* Default application providers for testing without a compiler.
|
* Default application providers for testing without a compiler.
|
||||||
*/
|
*/
|
||||||
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([
|
/*@ts2dart_const*/ [
|
||||||
BROWSER_APP_COMMON_PROVIDERS,
|
BROWSER_APP_COMMON_PROVIDERS,
|
||||||
new Provider(XHR, {useClass: XHRImpl}),
|
new Provider(XHR, {useClass: XHRImpl},
|
||||||
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
||||||
]);
|
]);
|
||||||
|
@ -38,7 +38,6 @@ import {
|
|||||||
import {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';
|
import {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';
|
||||||
import {LocationStrategy} from 'angular2/platform/common';
|
import {LocationStrategy} from 'angular2/platform/common';
|
||||||
|
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
import {Log} from 'angular2/src/testing/utils';
|
import {Log} from 'angular2/src/testing/utils';
|
||||||
|
|
||||||
@ -50,10 +49,11 @@ function initServerTests() {
|
|||||||
/**
|
/**
|
||||||
* Default platform providers for testing.
|
* Default platform providers for testing.
|
||||||
*/
|
*/
|
||||||
export const TEST_SERVER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const TEST_SERVER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
|
/*@ts2dart_const*/ [
|
||||||
PLATFORM_COMMON_PROVIDERS,
|
PLATFORM_COMMON_PROVIDERS,
|
||||||
new Provider(PLATFORM_INITIALIZER, {useValue: initServerTests, multi: true})
|
new Provider(PLATFORM_INITIALIZER, {useValue: initServerTests, multi: true}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function appDoc() {
|
function appDoc() {
|
||||||
try {
|
try {
|
||||||
@ -67,8 +67,8 @@ function appDoc() {
|
|||||||
* Default application providers for testing.
|
* Default application providers for testing.
|
||||||
*/
|
*/
|
||||||
export const TEST_SERVER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const TEST_SERVER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([
|
/*@ts2dart_const*/ [
|
||||||
// TODO(julie): when angular2/platform/server is available, use that instead of making our own
|
// TODO(julie: when angular2/platform/server is available, use that instead of making our own
|
||||||
// list here.
|
// list here.
|
||||||
APPLICATION_COMMON_PROVIDERS,
|
APPLICATION_COMMON_PROVIDERS,
|
||||||
COMPILER_PROVIDERS,
|
COMPILER_PROVIDERS,
|
||||||
|
@ -20,7 +20,6 @@ export {ROUTER_PROVIDERS, ROUTER_BINDINGS} from 'angular2/src/router/router_prov
|
|||||||
|
|
||||||
import {RouterOutlet} from './src/router/directives/router_outlet';
|
import {RouterOutlet} from './src/router/directives/router_outlet';
|
||||||
import {RouterLink} from './src/router/directives/router_link';
|
import {RouterLink} from './src/router/directives/router_link';
|
||||||
import {CONST_EXPR} from './src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of directives. To use the router directives like {@link RouterOutlet} and
|
* A list of directives. To use the router directives like {@link RouterOutlet} and
|
||||||
@ -44,4 +43,4 @@ import {CONST_EXPR} from './src/facade/lang';
|
|||||||
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const ROUTER_DIRECTIVES: any[] = CONST_EXPR([RouterOutlet, RouterLink]);
|
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink];
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import {TEMPLATE_TRANSFORMS} from 'angular2/compiler';
|
import {TEMPLATE_TRANSFORMS} from 'angular2/compiler';
|
||||||
import {Provider} from 'angular2/core';
|
import {Provider} from 'angular2/core';
|
||||||
import {RouterLinkTransform} from 'angular2/src/router/directives/router_link_transform';
|
import {RouterLinkTransform} from 'angular2/src/router/directives/router_link_transform';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
export {RouterLinkTransform} from 'angular2/src/router/directives/router_link_transform';
|
export {RouterLinkTransform} from 'angular2/src/router/directives/router_link_transform';
|
||||||
|
|
||||||
@ -32,4 +31,5 @@ export {RouterLinkTransform} from 'angular2/src/router/directives/router_link_tr
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const ROUTER_LINK_DSL_PROVIDER =
|
export const ROUTER_LINK_DSL_PROVIDER =
|
||||||
CONST_EXPR(new Provider(TEMPLATE_TRANSFORMS, {useClass: RouterLinkTransform, multi: true}));
|
/*@ts2dart_const*/
|
||||||
|
new Provider(TEMPLATE_TRANSFORMS, {useClass: RouterLinkTransform, multi: true});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {Type} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
import {FORM_DIRECTIVES} from './forms';
|
import {FORM_DIRECTIVES} from './forms';
|
||||||
import {CORE_DIRECTIVES} from './directives';
|
import {CORE_DIRECTIVES} from './directives';
|
||||||
@ -46,4 +46,4 @@ import {CORE_DIRECTIVES} from './directives';
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const COMMON_DIRECTIVES: Type[][] = CONST_EXPR([CORE_DIRECTIVES, FORM_DIRECTIVES]);
|
export const COMMON_DIRECTIVES: Type[][] = /*@ts2dart_const*/[CORE_DIRECTIVES, FORM_DIRECTIVES];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {Type} from 'angular2/src/facade/lang';
|
||||||
import {NgClass} from './ng_class';
|
import {NgClass} from './ng_class';
|
||||||
import {NgFor} from './ng_for';
|
import {NgFor} from './ng_for';
|
||||||
import {NgIf} from './ng_if';
|
import {NgIf} from './ng_if';
|
||||||
@ -47,7 +47,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const CORE_DIRECTIVES: Type[] = CONST_EXPR([
|
export const CORE_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
||||||
NgClass,
|
NgClass,
|
||||||
NgFor,
|
NgFor,
|
||||||
NgIf,
|
NgIf,
|
||||||
@ -58,4 +58,4 @@ export const CORE_DIRECTIVES: Type[] = CONST_EXPR([
|
|||||||
NgSwitchDefault,
|
NgSwitchDefault,
|
||||||
NgPlural,
|
NgPlural,
|
||||||
NgPluralCase
|
NgPluralCase
|
||||||
]);
|
];
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import {Directive, Host, ViewContainerRef, TemplateRef} from 'angular2/core';
|
import {Directive, Host, ViewContainerRef, TemplateRef} from 'angular2/core';
|
||||||
import {isPresent, isBlank, normalizeBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank, normalizeBlank} from 'angular2/src/facade/lang';
|
||||||
import {ListWrapper, Map} from 'angular2/src/facade/collection';
|
import {ListWrapper, Map} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
const _WHEN_DEFAULT = CONST_EXPR(new Object());
|
const _WHEN_DEFAULT = /*@ts2dart_const*/ new Object();
|
||||||
|
|
||||||
export class SwitchView {
|
export class SwitchView {
|
||||||
constructor(private _viewContainerRef: ViewContainerRef,
|
constructor(private _viewContainerRef: ViewContainerRef,
|
||||||
|
@ -43,7 +43,7 @@ export {
|
|||||||
export {FormBuilder} from './forms/form_builder';
|
export {FormBuilder} from './forms/form_builder';
|
||||||
import {FormBuilder} from './forms/form_builder';
|
import {FormBuilder} from './forms/form_builder';
|
||||||
import {RadioControlRegistry} from './forms/directives/radio_control_value_accessor';
|
import {RadioControlRegistry} from './forms/directives/radio_control_value_accessor';
|
||||||
import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {Type} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shorthand set of providers used for building Angular forms.
|
* Shorthand set of providers used for building Angular forms.
|
||||||
@ -54,11 +54,11 @@ import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
|||||||
* bootstrap(MyApp, [FORM_PROVIDERS]);
|
* bootstrap(MyApp, [FORM_PROVIDERS]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const FORM_PROVIDERS: Type[] = CONST_EXPR([FormBuilder, RadioControlRegistry]);
|
export const FORM_PROVIDERS: Type[] = /*@ts2dart_const*/[FormBuilder, RadioControlRegistry];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See {@link FORM_PROVIDERS} instead.
|
* See {@link FORM_PROVIDERS} instead.
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
export const FORM_BINDINGS = FORM_PROVIDERS;
|
export const FORM_BINDINGS = /*@ts2dart_const*/ FORM_PROVIDERS;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {Type} from 'angular2/src/facade/lang';
|
||||||
import {NgControlName} from './directives/ng_control_name';
|
import {NgControlName} from './directives/ng_control_name';
|
||||||
import {NgFormControl} from './directives/ng_form_control';
|
import {NgFormControl} from './directives/ng_form_control';
|
||||||
import {NgModel} from './directives/ng_model';
|
import {NgModel} from './directives/ng_model';
|
||||||
@ -64,7 +64,7 @@ export {ControlValueAccessor} from './directives/control_value_accessor';
|
|||||||
* class MyApp {}
|
* class MyApp {}
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const FORM_DIRECTIVES: Type[] = CONST_EXPR([
|
export const FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
||||||
NgControlName,
|
NgControlName,
|
||||||
NgControlGroup,
|
NgControlGroup,
|
||||||
|
|
||||||
@ -85,4 +85,4 @@ export const FORM_DIRECTIVES: Type[] = CONST_EXPR([
|
|||||||
MinLengthValidator,
|
MinLengthValidator,
|
||||||
MaxLengthValidator,
|
MaxLengthValidator,
|
||||||
PatternValidator
|
PatternValidator
|
||||||
]);
|
];
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import {Directive, Renderer, ElementRef, Self, forwardRef, Provider} from 'angular2/core';
|
import {Directive, Renderer, ElementRef, Self, forwardRef, Provider} from 'angular2/core';
|
||||||
|
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
export const CHECKBOX_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const CHECKBOX_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true}));
|
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The accessor for writing a value and listening to changes on a checkbox input element.
|
* The accessor for writing a value and listening to changes on a checkbox input element.
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import {OpaqueToken} from 'angular2/core';
|
import {OpaqueToken} from 'angular2/core';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A bridge between a control and a native element.
|
* A bridge between a control and a native element.
|
||||||
@ -31,4 +30,5 @@ export interface ControlValueAccessor {
|
|||||||
*
|
*
|
||||||
* See {@link DefaultValueAccessor} for how to implement one.
|
* See {@link DefaultValueAccessor} for how to implement one.
|
||||||
*/
|
*/
|
||||||
export const NG_VALUE_ACCESSOR: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValueAccessor"));
|
export const NG_VALUE_ACCESSOR: OpaqueToken =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken("NgValueAccessor");
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
|
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
import {isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isBlank} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
export const DEFAULT_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const DEFAULT_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => DefaultValueAccessor), multi: true}));
|
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => DefaultValueAccessor), multi: true});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default accessor for writing a value and listening to changes that is used by the
|
* The default accessor for writing a value and listening to changes that is used by the
|
||||||
|
@ -10,7 +10,6 @@ import {
|
|||||||
Provider,
|
Provider,
|
||||||
Self
|
Self
|
||||||
} from 'angular2/core';
|
} from 'angular2/core';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
import {ControlContainer} from './control_container';
|
import {ControlContainer} from './control_container';
|
||||||
import {controlPath, composeValidators, composeAsyncValidators} from './shared';
|
import {controlPath, composeValidators, composeAsyncValidators} from './shared';
|
||||||
@ -20,7 +19,8 @@ import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
|||||||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||||
|
|
||||||
export const controlGroupProvider =
|
export const controlGroupProvider =
|
||||||
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgControlGroup)}));
|
/*@ts2dart_const*/
|
||||||
|
new Provider(ControlContainer, {useExisting: forwardRef(() => NgControlGroup)});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and binds a control group to a DOM element.
|
* Creates and binds a control group to a DOM element.
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -32,7 +31,7 @@ import {ValidatorFn, AsyncValidatorFn} from './validators';
|
|||||||
|
|
||||||
|
|
||||||
export const controlNameBinding =
|
export const controlNameBinding =
|
||||||
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgControlName)}));
|
/*@ts2dart_const*/ new Provider(NgControl, {useExisting: forwardRef(() => NgControlName)});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and binds a control with a specified name to a DOM element.
|
* Creates and binds a control with a specified name to a DOM element.
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
PromiseCompleter
|
PromiseCompleter
|
||||||
} from 'angular2/src/facade/async';
|
} from 'angular2/src/facade/async';
|
||||||
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
||||||
import {isPresent, isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank} from 'angular2/src/facade/lang';
|
||||||
import {Directive, forwardRef, Provider, Optional, Inject, Self} from 'angular2/core';
|
import {Directive, forwardRef, Provider, Optional, Inject, Self} from 'angular2/core';
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
import {Form} from './form_interface';
|
import {Form} from './form_interface';
|
||||||
@ -15,8 +15,8 @@ import {AbstractControl, ControlGroup, Control} from '../model';
|
|||||||
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
|
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
|
||||||
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
||||||
|
|
||||||
export const formDirectiveProvider =
|
const formDirectiveProvider =
|
||||||
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgForm)}));
|
/*@ts2dart_const*/ new Provider(ControlContainer, {useExisting: forwardRef(() => NgForm)});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If `NgForm` is bound in a component, `<form>` elements in that component will be
|
* If `NgForm` is bound in a component, `<form>` elements in that component will be
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||||
import {
|
import {
|
||||||
@ -25,8 +24,8 @@ import {
|
|||||||
} from './shared';
|
} from './shared';
|
||||||
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
||||||
|
|
||||||
export const formControlBinding =
|
const formControlBinding =
|
||||||
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgFormControl)}));
|
/*@ts2dart_const*/ new Provider(NgControl, {useExisting: forwardRef(() => NgFormControl)});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds an existing {@link Control} to a DOM element.
|
* Binds an existing {@link Control} to a DOM element.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, isBlank} from 'angular2/src/facade/lang';
|
import {isBlank} from 'angular2/src/facade/lang';
|
||||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||||
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
||||||
@ -21,7 +21,8 @@ import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidato
|
|||||||
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
||||||
|
|
||||||
export const formDirectiveProvider =
|
export const formDirectiveProvider =
|
||||||
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgFormModel)}));
|
/*@ts2dart_const*/
|
||||||
|
new Provider(ControlContainer, {useExisting: forwardRef(() => NgFormModel)});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds an existing control group to a DOM element.
|
* Binds an existing control group to a DOM element.
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||||
import {
|
import {
|
||||||
OnChanges,
|
OnChanges,
|
||||||
@ -24,7 +23,7 @@ import {
|
|||||||
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
||||||
|
|
||||||
export const formControlBinding =
|
export const formControlBinding =
|
||||||
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgModel)}));
|
/*@ts2dart_const*/ new Provider(NgControl, {useExisting: forwardRef(() => NgModel)});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a domain model to a form control.
|
* Binds a domain model to a form control.
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
|
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
import {isBlank, CONST_EXPR, NumberWrapper} from 'angular2/src/facade/lang';
|
import {isBlank, NumberWrapper} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
export const NUMBER_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const NUMBER_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => NumberValueAccessor), multi: true}));
|
NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => NumberValueAccessor), multi: true}));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The accessor for writing a number value and listening to changes that is used by the
|
* The accessor for writing a number value and listening to changes that is used by the
|
||||||
|
@ -17,11 +17,11 @@ import {
|
|||||||
ControlValueAccessor
|
ControlValueAccessor
|
||||||
} from 'angular2/src/common/forms/directives/control_value_accessor';
|
} from 'angular2/src/common/forms/directives/control_value_accessor';
|
||||||
import {NgControl} from 'angular2/src/common/forms/directives/ng_control';
|
import {NgControl} from 'angular2/src/common/forms/directives/ng_control';
|
||||||
import {CONST_EXPR, looseIdentical, isPresent} from 'angular2/src/facade/lang';
|
import {looseIdentical, isPresent} from 'angular2/src/facade/lang';
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
export const RADIO_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const RADIO_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => RadioControlValueAccessor), multi: true}));
|
NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => RadioControlValueAccessor), multi: true}));
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
} from 'angular2/core';
|
} from 'angular2/core';
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
import {
|
import {
|
||||||
CONST_EXPR,
|
|
||||||
StringWrapper,
|
StringWrapper,
|
||||||
isPrimitive,
|
isPrimitive,
|
||||||
isPresent,
|
isPresent,
|
||||||
@ -21,8 +20,8 @@ import {
|
|||||||
|
|
||||||
import {MapWrapper} from 'angular2/src/facade/collection';
|
import {MapWrapper} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
export const SELECT_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const SELECT_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => SelectControlValueAccessor), multi: true}));
|
NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => SelectControlValueAccessor), multi: true}));
|
||||||
|
|
||||||
function _buildValueString(id: string, value: any): string {
|
function _buildValueString(id: string, value: any): string {
|
||||||
if (isBlank(id)) return `${value}`;
|
if (isBlank(id)) return `${value}`;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {forwardRef, Provider, Attribute, Directive} from 'angular2/core';
|
import {forwardRef, Provider, Attribute, Directive} from 'angular2/core';
|
||||||
import {CONST_EXPR, NumberWrapper} from 'angular2/src/facade/lang';
|
import {NumberWrapper} from 'angular2/src/facade/lang';
|
||||||
import {Validators, NG_VALIDATORS} from '../validators';
|
import {Validators, NG_VALIDATORS} from '../validators';
|
||||||
import {AbstractControl} from '../model';
|
import {AbstractControl} from '../model';
|
||||||
import * as modelModule from '../model';
|
import * as modelModule from '../model';
|
||||||
@ -25,10 +25,10 @@ import * as modelModule from '../model';
|
|||||||
*/
|
*/
|
||||||
export interface Validator { validate(c: modelModule.AbstractControl): {[key: string]: any}; }
|
export interface Validator { validate(c: modelModule.AbstractControl): {[key: string]: any}; }
|
||||||
|
|
||||||
const REQUIRED = /*@ts2dart_const*/(Validators.required);
|
const REQUIRED = /*@ts2dart_const*/ Validators.required;
|
||||||
|
|
||||||
export const REQUIRED_VALIDATOR =
|
export const REQUIRED_VALIDATOR =
|
||||||
CONST_EXPR(new Provider(NG_VALIDATORS, {useValue: REQUIRED, multi: true}));
|
/*@ts2dart_const*/ new Provider(NG_VALIDATORS, {useValue: REQUIRED, multi: true});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Directive that adds the `required` validator to any controls marked with the
|
* A Directive that adds the `required` validator to any controls marked with the
|
||||||
@ -59,8 +59,8 @@ export interface AsyncValidatorFn {
|
|||||||
*
|
*
|
||||||
* {@example common/forms/ts/validators/validators.ts region='min'}
|
* {@example common/forms/ts/validators/validators.ts region='min'}
|
||||||
*/
|
*/
|
||||||
export const MIN_LENGTH_VALIDATOR = CONST_EXPR(
|
export const MIN_LENGTH_VALIDATOR = /*@ts2dart_const*/
|
||||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => MinLengthValidator), multi: true}));
|
new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => MinLengthValidator), multi: true}));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A directive which installs the {@link MinLengthValidator} for any `ngControl`,
|
* A directive which installs the {@link MinLengthValidator} for any `ngControl`,
|
||||||
@ -87,8 +87,8 @@ export class MinLengthValidator implements Validator {
|
|||||||
*
|
*
|
||||||
* {@example common/forms/ts/validators/validators.ts region='max'}
|
* {@example common/forms/ts/validators/validators.ts region='max'}
|
||||||
*/
|
*/
|
||||||
export const MAX_LENGTH_VALIDATOR = CONST_EXPR(
|
export const MAX_LENGTH_VALIDATOR = /*@ts2dart_const*/
|
||||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => MaxLengthValidator), multi: true}));
|
new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => MaxLengthValidator), multi: true}));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A directive which installs the {@link MaxLengthValidator} for any `ngControl, `ngFormControl`,
|
* A directive which installs the {@link MaxLengthValidator} for any `ngControl, `ngFormControl`,
|
||||||
@ -121,8 +121,8 @@ export class MaxLengthValidator implements Validator {
|
|||||||
* <input [ngControl]="fullName" pattern="[a-zA-Z ]*">
|
* <input [ngControl]="fullName" pattern="[a-zA-Z ]*">
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const PATTERN_VALIDATOR = CONST_EXPR(
|
export const PATTERN_VALIDATOR = /*@ts2dart_const*/
|
||||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => PatternValidator), multi: true}));
|
new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => PatternValidator), multi: true}));
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[pattern][ngControl],[pattern][ngFormControl],[pattern][ngModel]',
|
selector: '[pattern][ngControl],[pattern][ngFormControl],[pattern][ngModel]',
|
||||||
providers: [PATTERN_VALIDATOR]
|
providers: [PATTERN_VALIDATOR]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {Injectable} from 'angular2/core';
|
import {Injectable} from 'angular2/core';
|
||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
import {isPresent, isArray, CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {isPresent, isArray, Type} from 'angular2/src/facade/lang';
|
||||||
import * as modelModule from './model';
|
import * as modelModule from './model';
|
||||||
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {isBlank, isPresent, CONST_EXPR, isString} from 'angular2/src/facade/lang';
|
import {isBlank, isPresent, isString} from 'angular2/src/facade/lang';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
||||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
@ -16,7 +16,7 @@ import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
|||||||
*
|
*
|
||||||
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
|
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
|
||||||
*/
|
*/
|
||||||
export const NG_VALIDATORS: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValidators"));
|
export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken("NgValidators");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Providers for asynchronous validators to be used for {@link Control}s
|
* Providers for asynchronous validators to be used for {@link Control}s
|
||||||
@ -26,7 +26,8 @@ export const NG_VALIDATORS: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValidato
|
|||||||
*
|
*
|
||||||
* See {@link NG_VALIDATORS} for more details.
|
* See {@link NG_VALIDATORS} for more details.
|
||||||
*/
|
*/
|
||||||
export const NG_ASYNC_VALIDATORS: OpaqueToken = CONST_EXPR(new OpaqueToken("NgAsyncValidators"));
|
export const NG_ASYNC_VALIDATORS: OpaqueToken =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken("NgAsyncValidators");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a set of validators used by form controls.
|
* Provides a set of validators used by form controls.
|
||||||
|
@ -13,7 +13,6 @@ import {DecimalPipe, PercentPipe, CurrencyPipe} from './number_pipe';
|
|||||||
import {ReplacePipe} from './replace_pipe';
|
import {ReplacePipe} from './replace_pipe';
|
||||||
import {I18nPluralPipe} from './i18n_plural_pipe';
|
import {I18nPluralPipe} from './i18n_plural_pipe';
|
||||||
import {I18nSelectPipe} from './i18n_select_pipe';
|
import {I18nSelectPipe} from './i18n_select_pipe';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of Angular core pipes that are likely to be used in each and every
|
* A collection of Angular core pipes that are likely to be used in each and every
|
||||||
@ -22,7 +21,7 @@ import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|||||||
* This collection can be used to quickly enumerate all the built-in pipes in the `pipes`
|
* This collection can be used to quickly enumerate all the built-in pipes in the `pipes`
|
||||||
* property of the `@Component` decorator.
|
* property of the `@Component` decorator.
|
||||||
*/
|
*/
|
||||||
export const COMMON_PIPES = CONST_EXPR([
|
export const COMMON_PIPES = /*@ts2dart_const*/[
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
UpperCasePipe,
|
UpperCasePipe,
|
||||||
LowerCasePipe,
|
LowerCasePipe,
|
||||||
@ -35,4 +34,4 @@ export const COMMON_PIPES = CONST_EXPR([
|
|||||||
ReplacePipe,
|
ReplacePipe,
|
||||||
I18nPluralPipe,
|
I18nPluralPipe,
|
||||||
I18nSelectPipe
|
I18nSelectPipe
|
||||||
]);
|
];
|
||||||
|
@ -1,63 +1,63 @@
|
|||||||
export const $EOF = /*@ts2dart_const*/(0);
|
export const $EOF = /*@ts2dart_const*/ 0;
|
||||||
export const $TAB = /*@ts2dart_const*/(9);
|
export const $TAB = /*@ts2dart_const*/ 9;
|
||||||
export const $LF = /*@ts2dart_const*/(10);
|
export const $LF = /*@ts2dart_const*/ 10;
|
||||||
export const $VTAB = /*@ts2dart_const*/(11);
|
export const $VTAB = /*@ts2dart_const*/ 11;
|
||||||
export const $FF = /*@ts2dart_const*/(12);
|
export const $FF = /*@ts2dart_const*/ 12;
|
||||||
export const $CR = /*@ts2dart_const*/(13);
|
export const $CR = /*@ts2dart_const*/ 13;
|
||||||
export const $SPACE = /*@ts2dart_const*/(32);
|
export const $SPACE = /*@ts2dart_const*/ 32;
|
||||||
export const $BANG = /*@ts2dart_const*/(33);
|
export const $BANG = /*@ts2dart_const*/ 33;
|
||||||
export const $DQ = /*@ts2dart_const*/(34);
|
export const $DQ = /*@ts2dart_const*/ 34;
|
||||||
export const $HASH = /*@ts2dart_const*/(35);
|
export const $HASH = /*@ts2dart_const*/ 35;
|
||||||
export const $$ = /*@ts2dart_const*/(36);
|
export const $$ = /*@ts2dart_const*/ 36;
|
||||||
export const $PERCENT = /*@ts2dart_const*/(37);
|
export const $PERCENT = /*@ts2dart_const*/ 37;
|
||||||
export const $AMPERSAND = /*@ts2dart_const*/(38);
|
export const $AMPERSAND = /*@ts2dart_const*/ 38;
|
||||||
export const $SQ = /*@ts2dart_const*/(39);
|
export const $SQ = /*@ts2dart_const*/ 39;
|
||||||
export const $LPAREN = /*@ts2dart_const*/(40);
|
export const $LPAREN = /*@ts2dart_const*/ 40;
|
||||||
export const $RPAREN = /*@ts2dart_const*/(41);
|
export const $RPAREN = /*@ts2dart_const*/ 41;
|
||||||
export const $STAR = /*@ts2dart_const*/(42);
|
export const $STAR = /*@ts2dart_const*/ 42;
|
||||||
export const $PLUS = /*@ts2dart_const*/(43);
|
export const $PLUS = /*@ts2dart_const*/ 43;
|
||||||
export const $COMMA = /*@ts2dart_const*/(44);
|
export const $COMMA = /*@ts2dart_const*/ 44;
|
||||||
export const $MINUS = /*@ts2dart_const*/(45);
|
export const $MINUS = /*@ts2dart_const*/ 45;
|
||||||
export const $PERIOD = /*@ts2dart_const*/(46);
|
export const $PERIOD = /*@ts2dart_const*/ 46;
|
||||||
export const $SLASH = /*@ts2dart_const*/(47);
|
export const $SLASH = /*@ts2dart_const*/ 47;
|
||||||
export const $COLON = /*@ts2dart_const*/(58);
|
export const $COLON = /*@ts2dart_const*/ 58;
|
||||||
export const $SEMICOLON = /*@ts2dart_const*/(59);
|
export const $SEMICOLON = /*@ts2dart_const*/ 59;
|
||||||
export const $LT = /*@ts2dart_const*/(60);
|
export const $LT = /*@ts2dart_const*/ 60;
|
||||||
export const $EQ = /*@ts2dart_const*/(61);
|
export const $EQ = /*@ts2dart_const*/ 61;
|
||||||
export const $GT = /*@ts2dart_const*/(62);
|
export const $GT = /*@ts2dart_const*/ 62;
|
||||||
export const $QUESTION = /*@ts2dart_const*/(63);
|
export const $QUESTION = /*@ts2dart_const*/ 63;
|
||||||
|
|
||||||
export const $0 = /*@ts2dart_const*/(48);
|
export const $0 = /*@ts2dart_const*/ 48;
|
||||||
export const $9 = /*@ts2dart_const*/(57);
|
export const $9 = /*@ts2dart_const*/ 57;
|
||||||
|
|
||||||
export const $A = /*@ts2dart_const*/(65);
|
export const $A = /*@ts2dart_const*/ 65;
|
||||||
export const $E = /*@ts2dart_const*/(69);
|
export const $E = /*@ts2dart_const*/ 69;
|
||||||
export const $Z = /*@ts2dart_const*/(90);
|
export const $Z = /*@ts2dart_const*/ 90;
|
||||||
|
|
||||||
export const $LBRACKET = /*@ts2dart_const*/(91);
|
export const $LBRACKET = /*@ts2dart_const*/ 91;
|
||||||
export const $BACKSLASH = /*@ts2dart_const*/(92);
|
export const $BACKSLASH = /*@ts2dart_const*/ 92;
|
||||||
export const $RBRACKET = /*@ts2dart_const*/(93);
|
export const $RBRACKET = /*@ts2dart_const*/ 93;
|
||||||
export const $CARET = /*@ts2dart_const*/(94);
|
export const $CARET = /*@ts2dart_const*/ 94;
|
||||||
export const $_ = /*@ts2dart_const*/(95);
|
export const $_ = /*@ts2dart_const*/ 95;
|
||||||
|
|
||||||
export const $a = /*@ts2dart_const*/(97);
|
export const $a = /*@ts2dart_const*/ 97;
|
||||||
export const $e = /*@ts2dart_const*/(101);
|
export const $e = /*@ts2dart_const*/ 101;
|
||||||
export const $f = /*@ts2dart_const*/(102);
|
export const $f = /*@ts2dart_const*/ 102;
|
||||||
export const $n = /*@ts2dart_const*/(110);
|
export const $n = /*@ts2dart_const*/ 110;
|
||||||
export const $r = /*@ts2dart_const*/(114);
|
export const $r = /*@ts2dart_const*/ 114;
|
||||||
export const $t = /*@ts2dart_const*/(116);
|
export const $t = /*@ts2dart_const*/ 116;
|
||||||
export const $u = /*@ts2dart_const*/(117);
|
export const $u = /*@ts2dart_const*/ 117;
|
||||||
export const $v = /*@ts2dart_const*/(118);
|
export const $v = /*@ts2dart_const*/ 118;
|
||||||
export const $z = /*@ts2dart_const*/(122);
|
export const $z = /*@ts2dart_const*/ 122;
|
||||||
|
|
||||||
export const $LBRACE = /*@ts2dart_const*/(123);
|
export const $LBRACE = /*@ts2dart_const*/ 123;
|
||||||
export const $BAR = /*@ts2dart_const*/(124);
|
export const $BAR = /*@ts2dart_const*/ 124;
|
||||||
export const $RBRACE = /*@ts2dart_const*/(125);
|
export const $RBRACE = /*@ts2dart_const*/ 125;
|
||||||
export const $NBSP = /*@ts2dart_const*/(160);
|
export const $NBSP = /*@ts2dart_const*/ 160;
|
||||||
|
|
||||||
export const $PIPE = /*@ts2dart_const*/(124);
|
export const $PIPE = /*@ts2dart_const*/ 124;
|
||||||
export const $TILDA = /*@ts2dart_const*/(126);
|
export const $TILDA = /*@ts2dart_const*/ 126;
|
||||||
export const $AT = /*@ts2dart_const*/(64);
|
export const $AT = /*@ts2dart_const*/ 64;
|
||||||
|
|
||||||
export function isWhitespace(code: number): boolean {
|
export function isWhitespace(code: number): boolean {
|
||||||
return (code >= $TAB && code <= $SPACE) || (code == $NBSP);
|
return (code >= $TAB && code <= $SPACE) || (code == $NBSP);
|
||||||
|
@ -12,7 +12,7 @@ export {ViewResolver} from './view_resolver';
|
|||||||
export {DirectiveResolver} from './directive_resolver';
|
export {DirectiveResolver} from './directive_resolver';
|
||||||
export {PipeResolver} from './pipe_resolver';
|
export {PipeResolver} from './pipe_resolver';
|
||||||
|
|
||||||
import {assertionsEnabled, Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {assertionsEnabled, Type} from 'angular2/src/facade/lang';
|
||||||
import {provide, Provider} from 'angular2/src/core/di';
|
import {provide, Provider} from 'angular2/src/core/di';
|
||||||
import {TemplateParser} from 'angular2/src/compiler/template_parser';
|
import {TemplateParser} from 'angular2/src/compiler/template_parser';
|
||||||
import {HtmlParser} from 'angular2/src/compiler/html_parser';
|
import {HtmlParser} from 'angular2/src/compiler/html_parser';
|
||||||
@ -40,7 +40,7 @@ function _createCompilerConfig() {
|
|||||||
* A set of providers that provide `RuntimeCompiler` and its dependencies to use for
|
* A set of providers that provide `RuntimeCompiler` and its dependencies to use for
|
||||||
* template compilation.
|
* template compilation.
|
||||||
*/
|
*/
|
||||||
export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = CONST_EXPR([
|
export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = /*@ts2dart_const*/ [
|
||||||
Lexer,
|
Lexer,
|
||||||
Parser,
|
Parser,
|
||||||
HtmlParser,
|
HtmlParser,
|
||||||
@ -50,7 +50,7 @@ export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = CONST_EXPR([
|
|||||||
DEFAULT_PACKAGE_URL_PROVIDER,
|
DEFAULT_PACKAGE_URL_PROVIDER,
|
||||||
StyleCompiler,
|
StyleCompiler,
|
||||||
ViewCompiler,
|
ViewCompiler,
|
||||||
new Provider(CompilerConfig, {useFactory: _createCompilerConfig, deps: []}),
|
new Provider(CompilerConfig, {useFactory: _createCompilerConfig, deps: []},
|
||||||
RuntimeCompiler,
|
RuntimeCompiler,
|
||||||
new Provider(ComponentResolver, {useExisting: RuntimeCompiler}),
|
new Provider(ComponentResolver, {useExisting: RuntimeCompiler}),
|
||||||
DomElementSchemaRegistry,
|
DomElementSchemaRegistry,
|
||||||
|
@ -110,54 +110,54 @@ function newNumberToken(index: number, n: number): Token {
|
|||||||
|
|
||||||
export var EOF: Token = new Token(-1, TokenType.Character, 0, "");
|
export var EOF: Token = new Token(-1, TokenType.Character, 0, "");
|
||||||
|
|
||||||
export const $EOF = /*@ts2dart_const*/(0);
|
export const $EOF = /*@ts2dart_const*/ 0;
|
||||||
export const $TAB = /*@ts2dart_const*/(9);
|
export const $TAB = /*@ts2dart_const*/ 9;
|
||||||
export const $LF = /*@ts2dart_const*/(10);
|
export const $LF = /*@ts2dart_const*/ 10;
|
||||||
export const $VTAB = /*@ts2dart_const*/(11);
|
export const $VTAB = /*@ts2dart_const*/ 11;
|
||||||
export const $FF = /*@ts2dart_const*/(12);
|
export const $FF = /*@ts2dart_const*/ 12;
|
||||||
export const $CR = /*@ts2dart_const*/(13);
|
export const $CR = /*@ts2dart_const*/ 13;
|
||||||
export const $SPACE = /*@ts2dart_const*/(32);
|
export const $SPACE = /*@ts2dart_const*/ 32;
|
||||||
export const $BANG = /*@ts2dart_const*/(33);
|
export const $BANG = /*@ts2dart_const*/ 33;
|
||||||
export const $DQ = /*@ts2dart_const*/(34);
|
export const $DQ = /*@ts2dart_const*/ 34;
|
||||||
export const $HASH = /*@ts2dart_const*/(35);
|
export const $HASH = /*@ts2dart_const*/ 35;
|
||||||
export const $$ = /*@ts2dart_const*/(36);
|
export const $$ = /*@ts2dart_const*/ 36;
|
||||||
export const $PERCENT = /*@ts2dart_const*/(37);
|
export const $PERCENT = /*@ts2dart_const*/ 37;
|
||||||
export const $AMPERSAND = /*@ts2dart_const*/(38);
|
export const $AMPERSAND = /*@ts2dart_const*/ 38;
|
||||||
export const $SQ = /*@ts2dart_const*/(39);
|
export const $SQ = /*@ts2dart_const*/ 39;
|
||||||
export const $LPAREN = /*@ts2dart_const*/(40);
|
export const $LPAREN = /*@ts2dart_const*/ 40;
|
||||||
export const $RPAREN = /*@ts2dart_const*/(41);
|
export const $RPAREN = /*@ts2dart_const*/ 41;
|
||||||
export const $STAR = /*@ts2dart_const*/(42);
|
export const $STAR = /*@ts2dart_const*/ 42;
|
||||||
export const $PLUS = /*@ts2dart_const*/(43);
|
export const $PLUS = /*@ts2dart_const*/ 43;
|
||||||
export const $COMMA = /*@ts2dart_const*/(44);
|
export const $COMMA = /*@ts2dart_const*/ 44;
|
||||||
export const $MINUS = /*@ts2dart_const*/(45);
|
export const $MINUS = /*@ts2dart_const*/ 45;
|
||||||
export const $PERIOD = /*@ts2dart_const*/(46);
|
export const $PERIOD = /*@ts2dart_const*/ 46;
|
||||||
export const $SLASH = /*@ts2dart_const*/(47);
|
export const $SLASH = /*@ts2dart_const*/ 47;
|
||||||
export const $COLON = /*@ts2dart_const*/(58);
|
export const $COLON = /*@ts2dart_const*/ 58;
|
||||||
export const $SEMICOLON = /*@ts2dart_const*/(59);
|
export const $SEMICOLON = /*@ts2dart_const*/ 59;
|
||||||
export const $LT = /*@ts2dart_const*/(60);
|
export const $LT = /*@ts2dart_const*/ 60;
|
||||||
export const $EQ = /*@ts2dart_const*/(61);
|
export const $EQ = /*@ts2dart_const*/ 61;
|
||||||
export const $GT = /*@ts2dart_const*/(62);
|
export const $GT = /*@ts2dart_const*/ 62;
|
||||||
export const $QUESTION = /*@ts2dart_const*/(63);
|
export const $QUESTION = /*@ts2dart_const*/ 63;
|
||||||
|
|
||||||
const $0 = /*@ts2dart_const*/(48);
|
const $0 = /*@ts2dart_const*/ 48;
|
||||||
const $9 = /*@ts2dart_const*/(57);
|
const $9 = /*@ts2dart_const*/ 57;
|
||||||
|
|
||||||
const $A = /*@ts2dart_const*/(65), $E = /*@ts2dart_const*/(69), $Z = /*@ts2dart_const*/(90);
|
const $A = /*@ts2dart_const*/ 65, $E = /*@ts2dart_const*/ 69, $Z = /*@ts2dart_const*/ 90;
|
||||||
|
|
||||||
export const $LBRACKET = /*@ts2dart_const*/(91);
|
export const $LBRACKET = /*@ts2dart_const*/ 91;
|
||||||
export const $BACKSLASH = /*@ts2dart_const*/(92);
|
export const $BACKSLASH = /*@ts2dart_const*/ 92;
|
||||||
export const $RBRACKET = /*@ts2dart_const*/(93);
|
export const $RBRACKET = /*@ts2dart_const*/ 93;
|
||||||
const $CARET = /*@ts2dart_const*/(94);
|
const $CARET = /*@ts2dart_const*/ 94;
|
||||||
const $_ = /*@ts2dart_const*/(95);
|
const $_ = /*@ts2dart_const*/ 95;
|
||||||
export const $BT = /*@ts2dart_const*/(96);
|
export const $BT = /*@ts2dart_const*/ 96;
|
||||||
const $a = /*@ts2dart_const*/(97), $e = /*@ts2dart_const*/(101), $f = /*@ts2dart_const*/(102);
|
const $a = /*@ts2dart_const*/ 97, $e = /*@ts2dart_const*/ 101, $f = /*@ts2dart_const*/ 102;
|
||||||
const $n = /*@ts2dart_const*/(110), $r = /*@ts2dart_const*/(114), $t = /*@ts2dart_const*/(116)
|
const $n = /*@ts2dart_const*/ 110, $r = /*@ts2dart_const*/ 114, $t = /*@ts2dart_const*/ 116,
|
||||||
const $u = /*@ts2dart_const*/(117), $v = /*@ts2dart_const*/(118), $z = /*@ts2dart_const*/(122);
|
$u = /*@ts2dart_const*/ 117, $v = /*@ts2dart_const*/ 118, $z = /*@ts2dart_const*/ 122;
|
||||||
|
|
||||||
export const $LBRACE = /*@ts2dart_const*/(123);
|
export const $LBRACE = /*@ts2dart_const*/ 123;
|
||||||
export const $BAR = /*@ts2dart_const*/(124);
|
export const $BAR = /*@ts2dart_const*/ 124;
|
||||||
export const $RBRACE = /*@ts2dart_const*/(125);
|
export const $RBRACE = /*@ts2dart_const*/ 125;
|
||||||
const $NBSP = /*@ts2dart_const*/(160);
|
const $NBSP = /*@ts2dart_const*/ 160;
|
||||||
|
|
||||||
export class ScannerError extends BaseException {
|
export class ScannerError extends BaseException {
|
||||||
constructor(public message) { super(); }
|
constructor(public message) { super(); }
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
NumberWrapper,
|
NumberWrapper,
|
||||||
isPresent,
|
isPresent,
|
||||||
isBlank,
|
isBlank,
|
||||||
CONST_EXPR,
|
|
||||||
serializeEnum
|
serializeEnum
|
||||||
} from 'angular2/src/facade/lang';
|
} from 'angular2/src/facade/lang';
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
assertionsEnabled,
|
assertionsEnabled,
|
||||||
StringJoiner,
|
StringJoiner,
|
||||||
serializeEnum,
|
serializeEnum,
|
||||||
CONST_EXPR
|
|
||||||
} from 'angular2/src/facade/lang';
|
} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
|
@ -3,14 +3,13 @@ import {
|
|||||||
isBlank,
|
isBlank,
|
||||||
normalizeBool,
|
normalizeBool,
|
||||||
RegExpWrapper,
|
RegExpWrapper,
|
||||||
CONST_EXPR
|
|
||||||
} from 'angular2/src/facade/lang';
|
} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
// see http://www.w3.org/TR/html51/syntax.html#named-character-references
|
// see http://www.w3.org/TR/html51/syntax.html#named-character-references
|
||||||
// see https://html.spec.whatwg.org/multipage/entities.json
|
// see https://html.spec.whatwg.org/multipage/entities.json
|
||||||
// This list is not exhaustive to keep the compiler footprint low.
|
// This list is not exhaustive to keep the compiler footprint low.
|
||||||
// The `{` / `ƫ` syntax should be used when the named character reference does not exist.
|
// The `{` / `ƫ` syntax should be used when the named character reference does not exist.
|
||||||
export const NAMED_ENTITIES = CONST_EXPR({
|
export const NAMED_ENTITIES = /*@ts2dart_const*/ {
|
||||||
'Aacute': '\u00C1',
|
'Aacute': '\u00C1',
|
||||||
'aacute': '\u00E1',
|
'aacute': '\u00E1',
|
||||||
'Acirc': '\u00C2',
|
'Acirc': '\u00C2',
|
||||||
@ -263,7 +262,7 @@ export const NAMED_ENTITIES = CONST_EXPR({
|
|||||||
'zeta': '\u03B6',
|
'zeta': '\u03B6',
|
||||||
'zwj': '\u200D',
|
'zwj': '\u200D',
|
||||||
'zwnj': '\u200C',
|
'zwnj': '\u200C',
|
||||||
});
|
};
|
||||||
|
|
||||||
export enum HtmlTagContentType {
|
export enum HtmlTagContentType {
|
||||||
RAW_TEXT,
|
RAW_TEXT,
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
import {Injectable, Provider, provide} from 'angular2/src/core/di';
|
import {Injectable, Provider, provide} from 'angular2/src/core/di';
|
||||||
|
|
||||||
import {
|
import {StringWrapper, RegExpWrapper, isBlank, isPresent} from 'angular2/src/facade/lang';
|
||||||
StringWrapper,
|
|
||||||
RegExpWrapper,
|
|
||||||
CONST_EXPR,
|
|
||||||
isBlank,
|
|
||||||
isPresent
|
|
||||||
} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
HtmlAstVisitor,
|
HtmlAstVisitor,
|
||||||
@ -29,11 +23,11 @@ var TEMPLATE_SELECTOR_REGEXP = /^(\S+)/g;
|
|||||||
var SPECIAL_PREFIXES_REGEXP = /^(class|style|attr)\./ig;
|
var SPECIAL_PREFIXES_REGEXP = /^(class|style|attr)\./ig;
|
||||||
var INTERPOLATION_REGEXP = /\{\{.*?\}\}/g;
|
var INTERPOLATION_REGEXP = /\{\{.*?\}\}/g;
|
||||||
|
|
||||||
const SPECIAL_CASES = CONST_EXPR([
|
const SPECIAL_CASES = /*@ts2dart_const*/[
|
||||||
'ng-non-bindable',
|
'ng-non-bindable',
|
||||||
'ng-default-control',
|
'ng-default-control',
|
||||||
'ng-no-form',
|
'ng-no-form',
|
||||||
]);
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert templates to the case sensitive syntax
|
* Convert templates to the case sensitive syntax
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, isString, isPresent, isBlank} from 'angular2/src/facade/lang';
|
import {isString, isPresent, isBlank} from 'angular2/src/facade/lang';
|
||||||
import {CompileIdentifierMetadata} from '../compile_metadata';
|
import {CompileIdentifierMetadata} from '../compile_metadata';
|
||||||
|
|
||||||
//// Types
|
//// Types
|
||||||
@ -545,7 +545,7 @@ export class ClassStmt extends Statement {
|
|||||||
|
|
||||||
export class IfStmt extends Statement {
|
export class IfStmt extends Statement {
|
||||||
constructor(public condition: Expression, public trueCase: Statement[],
|
constructor(public condition: Expression, public trueCase: Statement[],
|
||||||
public falseCase: Statement[] = CONST_EXPR([])) {
|
public falseCase: Statement[] = /*@ts2dart_const*/[]) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
visitStatement(visitor: StatementVisitor, context: any): any {
|
visitStatement(visitor: StatementVisitor, context: any): any {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Injectable} from 'angular2/src/core/di';
|
import {Injectable} from 'angular2/src/core/di';
|
||||||
import {isPresent, isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank} from 'angular2/src/facade/lang';
|
||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||||
import {splitNsName} from 'angular2/src/compiler/html_tags';
|
import {splitNsName} from 'angular2/src/compiler/html_tags';
|
||||||
@ -7,7 +7,8 @@ import {splitNsName} from 'angular2/src/compiler/html_tags';
|
|||||||
import {ElementSchemaRegistry} from './element_schema_registry';
|
import {ElementSchemaRegistry} from './element_schema_registry';
|
||||||
|
|
||||||
const NAMESPACE_URIS =
|
const NAMESPACE_URIS =
|
||||||
CONST_EXPR({'xlink': 'http://www.w3.org/1999/xlink', 'svg': 'http://www.w3.org/2000/svg'});
|
/*@ts2dart_const*/
|
||||||
|
{'xlink': 'http://www.w3.org/1999/xlink', 'svg': 'http://www.w3.org/2000/svg'};
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
export class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
||||||
|
@ -12,8 +12,8 @@ import {Injectable} from 'angular2/src/core/di';
|
|||||||
import {isPresent} from 'angular2/src/facade/lang';
|
import {isPresent} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
const COMPONENT_VARIABLE = '%COMP%';
|
const COMPONENT_VARIABLE = '%COMP%';
|
||||||
const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
const HOST_ATTR = /*@ts2dart_const*/ `_nghost-${COMPONENT_VARIABLE}`;
|
||||||
const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
const CONTENT_ATTR = /*@ts2dart_const*/ `_ngcontent-${COMPONENT_VARIABLE}`;
|
||||||
|
|
||||||
export class StylesCompileDependency {
|
export class StylesCompileDependency {
|
||||||
constructor(public sourceUrl: string, public isShimmed: boolean,
|
constructor(public sourceUrl: string, public isShimmed: boolean,
|
||||||
|
@ -114,7 +114,7 @@ var TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];
|
|||||||
*
|
*
|
||||||
* This is currently an internal-only feature and not meant for general use.
|
* This is currently an internal-only feature and not meant for general use.
|
||||||
*/
|
*/
|
||||||
export const TEMPLATE_TRANSFORMS = CONST_EXPR(new OpaqueToken('TemplateTransforms'));
|
export const TEMPLATE_TRANSFORMS = /*@ts2dart_const*/ new OpaqueToken('TemplateTransforms');
|
||||||
|
|
||||||
export class TemplateParseError extends ParseError {
|
export class TemplateParseError extends ParseError {
|
||||||
constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel) {
|
constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel) {
|
||||||
|
@ -3,7 +3,7 @@ import * as o from '../output/output_ast';
|
|||||||
import {Identifiers} from '../identifiers';
|
import {Identifiers} from '../identifiers';
|
||||||
|
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||||
import {isBlank, isPresent, isArray, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isBlank, isPresent, isArray} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
var IMPLICIT_RECEIVER = o.variable('#implicit');
|
var IMPLICIT_RECEIVER = o.variable('#implicit');
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
TemplateAst
|
TemplateAst
|
||||||
} from '../template_ast';
|
} from '../template_ast';
|
||||||
|
|
||||||
import {isBlank, isPresent, isArray, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isBlank, isPresent, isArray} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
import {CompileView} from './compile_view';
|
import {CompileView} from './compile_view';
|
||||||
import {CompileElement, CompileNode} from './compile_element';
|
import {CompileElement, CompileNode} from './compile_element';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {Type} from 'angular2/src/facade/lang';
|
||||||
import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
|
import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
|
||||||
import {APP_ID_RANDOM_PROVIDER} from './application_tokens';
|
import {APP_ID_RANDOM_PROVIDER} from './application_tokens';
|
||||||
import {APPLICATION_CORE_PROVIDERS} from './application_ref';
|
import {APPLICATION_CORE_PROVIDERS} from './application_ref';
|
||||||
@ -18,9 +18,9 @@ var __unused: Type; // avoid unused import when Type union types are erased
|
|||||||
* A default set of providers which should be included in any Angular
|
* A default set of providers which should be included in any Angular
|
||||||
* application, regardless of the platform it runs onto.
|
* application, regardless of the platform it runs onto.
|
||||||
*/
|
*/
|
||||||
export const APPLICATION_COMMON_PROVIDERS: Array<Type | Provider | any[]> = CONST_EXPR([
|
export const APPLICATION_COMMON_PROVIDERS: Array<Type | Provider | any[]> = /*@ts2dart_const*/ [
|
||||||
APPLICATION_CORE_PROVIDERS,
|
APPLICATION_CORE_PROVIDERS,
|
||||||
new Provider(ComponentResolver, {useClass: ReflectorComponentResolver}),
|
new Provider(ComponentResolver, {useClass: ReflectorComponentResolver},
|
||||||
APP_ID_RANDOM_PROVIDER,
|
APP_ID_RANDOM_PROVIDER,
|
||||||
ViewUtils,
|
ViewUtils,
|
||||||
new Provider(IterableDiffers, {useValue: defaultIterableDiffers}),
|
new Provider(IterableDiffers, {useValue: defaultIterableDiffers}),
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
assertionsEnabled,
|
assertionsEnabled,
|
||||||
print,
|
print,
|
||||||
IS_DART,
|
IS_DART,
|
||||||
CONST_EXPR,
|
|
||||||
lockMode,
|
lockMode,
|
||||||
isPromise
|
isPromise
|
||||||
} from 'angular2/src/facade/lang';
|
} from 'angular2/src/facade/lang';
|
||||||
@ -436,13 +435,13 @@ export class ApplicationRef_ extends ApplicationRef {
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const PLATFORM_CORE_PROVIDERS =
|
export const PLATFORM_CORE_PROVIDERS =
|
||||||
CONST_EXPR([PlatformRef_, CONST_EXPR(new Provider(PlatformRef, {useExisting: PlatformRef_}))]);
|
/*@ts2dart_const*/[PlatformRef_, new Provider(PlatformRef, {useExisting: PlatformRef_})];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const APPLICATION_CORE_PROVIDERS = CONST_EXPR([
|
export const APPLICATION_CORE_PROVIDERS = /*@ts2dart_const*/[
|
||||||
CONST_EXPR(new Provider(NgZone, {useFactory: createNgZone, deps: CONST_EXPR([])})),
|
new Provider(NgZone, {useFactory: createNgZone, deps: []}),
|
||||||
ApplicationRef_,
|
ApplicationRef_,
|
||||||
CONST_EXPR(new Provider(ApplicationRef, {useExisting: ApplicationRef_}))
|
new Provider(ApplicationRef, {useExisting: ApplicationRef_})
|
||||||
]);
|
];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {OpaqueToken, Provider} from 'angular2/src/core/di';
|
import {OpaqueToken, Provider} from 'angular2/src/core/di';
|
||||||
import {CONST_EXPR, Math, StringWrapper} from 'angular2/src/facade/lang';
|
import {Math, StringWrapper} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A DI Token representing a unique string id assigned to the application by Angular and used
|
* A DI Token representing a unique string id assigned to the application by Angular and used
|
||||||
@ -10,7 +10,7 @@ import {CONST_EXPR, Math, StringWrapper} from 'angular2/src/facade/lang';
|
|||||||
* a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}
|
* a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}
|
||||||
* using this token.
|
* using this token.
|
||||||
*/
|
*/
|
||||||
export const APP_ID: OpaqueToken = CONST_EXPR(new OpaqueToken('AppId'));
|
export const APP_ID: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('AppId');
|
||||||
|
|
||||||
function _appIdRandomProviderFactory() {
|
function _appIdRandomProviderFactory() {
|
||||||
return `${_randomChar()}${_randomChar()}${_randomChar()}`;
|
return `${_randomChar()}${_randomChar()}${_randomChar()}`;
|
||||||
@ -20,7 +20,7 @@ function _appIdRandomProviderFactory() {
|
|||||||
* Providers that will generate a random APP_ID_TOKEN.
|
* Providers that will generate a random APP_ID_TOKEN.
|
||||||
*/
|
*/
|
||||||
export const APP_ID_RANDOM_PROVIDER: Provider =
|
export const APP_ID_RANDOM_PROVIDER: Provider =
|
||||||
CONST_EXPR(new Provider(APP_ID, {useFactory: _appIdRandomProviderFactory, deps: []}));
|
/*@ts2dart_const*/ new Provider(APP_ID, {useFactory: _appIdRandomProviderFactory, deps: []});
|
||||||
|
|
||||||
function _randomChar(): string {
|
function _randomChar(): string {
|
||||||
return StringWrapper.fromCharCode(97 + Math.floor(Math.random() * 25));
|
return StringWrapper.fromCharCode(97 + Math.floor(Math.random() * 25));
|
||||||
@ -30,15 +30,16 @@ function _randomChar(): string {
|
|||||||
* A function that will be executed when a platform is initialized.
|
* A function that will be executed when a platform is initialized.
|
||||||
*/
|
*/
|
||||||
export const PLATFORM_INITIALIZER: OpaqueToken =
|
export const PLATFORM_INITIALIZER: OpaqueToken =
|
||||||
CONST_EXPR(new OpaqueToken("Platform Initializer"));
|
/*@ts2dart_const*/ new OpaqueToken("Platform Initializer");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function that will be executed when an application is initialized.
|
* A function that will be executed when an application is initialized.
|
||||||
*/
|
*/
|
||||||
export const APP_INITIALIZER: OpaqueToken = CONST_EXPR(new OpaqueToken("Application Initializer"));
|
export const APP_INITIALIZER: OpaqueToken =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken("Application Initializer");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A token which indicates the root directory of the application
|
* A token which indicates the root directory of the application
|
||||||
*/
|
*/
|
||||||
export const PACKAGE_ROOT_URL: OpaqueToken =
|
export const PACKAGE_ROOT_URL: OpaqueToken =
|
||||||
CONST_EXPR(new OpaqueToken("Application Packages Root URL"));
|
/*@ts2dart_const*/ new OpaqueToken("Application Packages Root URL");
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
DefaultKeyValueDifferFactory,
|
DefaultKeyValueDifferFactory,
|
||||||
KeyValueChangeRecord
|
KeyValueChangeRecord
|
||||||
} from './differs/default_keyvalue_differ';
|
} from './differs/default_keyvalue_differ';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
DefaultKeyValueDifferFactory,
|
DefaultKeyValueDifferFactory,
|
||||||
@ -46,14 +45,14 @@ export {
|
|||||||
* Structural diffing for `Object`s and `Map`s.
|
* Structural diffing for `Object`s and `Map`s.
|
||||||
*/
|
*/
|
||||||
export const keyValDiff: KeyValueDifferFactory[] =
|
export const keyValDiff: KeyValueDifferFactory[] =
|
||||||
CONST_EXPR([CONST_EXPR(new DefaultKeyValueDifferFactory())]);
|
/*@ts2dart_const*/[new DefaultKeyValueDifferFactory()];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structural diffing for `Iterable` types such as `Array`s.
|
* Structural diffing for `Iterable` types such as `Array`s.
|
||||||
*/
|
*/
|
||||||
export const iterableDiff: IterableDifferFactory[] =
|
export const iterableDiff: IterableDifferFactory[] =
|
||||||
CONST_EXPR([CONST_EXPR(new DefaultIterableDifferFactory())]);
|
/*@ts2dart_const*/[new DefaultIterableDifferFactory()];
|
||||||
|
|
||||||
export const defaultIterableDiffers = CONST_EXPR(new IterableDiffers(iterableDiff));
|
export const defaultIterableDiffers = /*@ts2dart_const*/ new IterableDiffers(iterableDiff);
|
||||||
|
|
||||||
export const defaultKeyValueDiffers = CONST_EXPR(new KeyValueDiffers(keyValDiff));
|
export const defaultKeyValueDiffers = /*@ts2dart_const*/ new KeyValueDiffers(keyValDiff);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, isBlank, looseIdentical, isPrimitive} from 'angular2/src/facade/lang';
|
import {isBlank, looseIdentical, isPrimitive} from 'angular2/src/facade/lang';
|
||||||
import {
|
import {
|
||||||
StringMapWrapper,
|
StringMapWrapper,
|
||||||
isListLikeIterable,
|
isListLikeIterable,
|
||||||
@ -6,7 +6,7 @@ import {
|
|||||||
} from 'angular2/src/facade/collection';
|
} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
export {looseIdentical} from 'angular2/src/facade/lang';
|
export {looseIdentical} from 'angular2/src/facade/lang';
|
||||||
export var uninitialized: Object = CONST_EXPR<Object>(new Object());
|
export var uninitialized: Object = /*@ts2dart_const*/<Object>(new Object());
|
||||||
|
|
||||||
export function devModeEqual(a: any, b: any): boolean {
|
export function devModeEqual(a: any, b: any): boolean {
|
||||||
if (isListLikeIterable(a) && isListLikeIterable(b)) {
|
if (isListLikeIterable(a) && isListLikeIterable(b)) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {unimplemented} from 'angular2/src/facade/exceptions';
|
import {unimplemented} from 'angular2/src/facade/exceptions';
|
||||||
|
|
||||||
const _THROW_IF_NOT_FOUND = CONST_EXPR(new Object());
|
const _THROW_IF_NOT_FOUND = /*@ts2dart_const*/ new Object();
|
||||||
export const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
|
export const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
|
||||||
|
|
||||||
export abstract class Injector {
|
export abstract class Injector {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST, CONST_EXPR, stringify, isBlank, isPresent} from "angular2/src/facade/lang";
|
import {CONST, stringify, isBlank, isPresent} from "angular2/src/facade/lang";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A parameter metadata that specifies a dependency.
|
* A parameter metadata that specifies a dependency.
|
||||||
|
@ -14,7 +14,7 @@ import {
|
|||||||
InvalidProviderError,
|
InvalidProviderError,
|
||||||
OutOfBoundsError
|
OutOfBoundsError
|
||||||
} from './reflective_exceptions';
|
} from './reflective_exceptions';
|
||||||
import {Type, CONST_EXPR, isPresent} from 'angular2/src/facade/lang';
|
import {Type, isPresent} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, unimplemented} from 'angular2/src/facade/exceptions';
|
import {BaseException, unimplemented} from 'angular2/src/facade/exceptions';
|
||||||
import {ReflectiveKey} from './reflective_key';
|
import {ReflectiveKey} from './reflective_key';
|
||||||
import {SelfMetadata, HostMetadata, SkipSelfMetadata} from './metadata';
|
import {SelfMetadata, HostMetadata, SkipSelfMetadata} from './metadata';
|
||||||
@ -24,7 +24,7 @@ var __unused: Type; // avoid unused import when Type union types are erased
|
|||||||
|
|
||||||
// Threshold for the dynamic version
|
// Threshold for the dynamic version
|
||||||
const _MAX_CONSTRUCTION_COUNTER = 10;
|
const _MAX_CONSTRUCTION_COUNTER = 10;
|
||||||
const UNDEFINED = CONST_EXPR(new Object());
|
const UNDEFINED = /*@ts2dart_const*/ new Object();
|
||||||
|
|
||||||
export interface ReflectiveProtoInjectorStrategy {
|
export interface ReflectiveProtoInjectorStrategy {
|
||||||
getProviderAtIndex(index: number): ResolvedReflectiveProvider;
|
getProviderAtIndex(index: number): ResolvedReflectiveProvider;
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
import {
|
import {Type, isBlank, isPresent, CONST, isArray, isType} from 'angular2/src/facade/lang';
|
||||||
Type,
|
|
||||||
isBlank,
|
|
||||||
isPresent,
|
|
||||||
CONST,
|
|
||||||
CONST_EXPR,
|
|
||||||
isArray,
|
|
||||||
isType
|
|
||||||
} from 'angular2/src/facade/lang';
|
|
||||||
import {MapWrapper, ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
import {MapWrapper, ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||||
import {ReflectiveKey} from './reflective_key';
|
import {ReflectiveKey} from './reflective_key';
|
||||||
@ -41,7 +33,7 @@ export class ReflectiveDependency {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const _EMPTY_LIST = CONST_EXPR([]);
|
const _EMPTY_LIST = /*@ts2dart_const*/[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An internal resolved representation of a {@link Provider} used by the {@link Injector}.
|
* An internal resolved representation of a {@link Provider} used by the {@link Injector}.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import {isBlank, stringify, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isBlank, stringify} from 'angular2/src/facade/lang';
|
||||||
import {Injector, THROW_IF_NOT_FOUND} from 'angular2/src/core/di/injector';
|
import {Injector, THROW_IF_NOT_FOUND} from 'angular2/src/core/di/injector';
|
||||||
import {AppView} from './view';
|
import {AppView} from './view';
|
||||||
|
|
||||||
const _UNDEFINED = CONST_EXPR(new Object());
|
const _UNDEFINED = /*@ts2dart_const*/ new Object();
|
||||||
|
|
||||||
export class ElementInjector extends Injector {
|
export class ElementInjector extends Injector {
|
||||||
constructor(private _view: AppView<any>, private _nodeIndex: number) { super(); }
|
constructor(private _view: AppView<any>, private _nodeIndex: number) { super(); }
|
||||||
|
@ -17,7 +17,6 @@ import {
|
|||||||
isArray,
|
isArray,
|
||||||
isNumber,
|
isNumber,
|
||||||
CONST,
|
CONST,
|
||||||
CONST_EXPR,
|
|
||||||
stringify,
|
stringify,
|
||||||
isPrimitive,
|
isPrimitive,
|
||||||
isString
|
isString
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import {
|
import {isBlank, isPresent, Type, stringify, looseIdentical} from 'angular2/src/facade/lang';
|
||||||
isBlank,
|
|
||||||
isPresent,
|
|
||||||
Type,
|
|
||||||
stringify,
|
|
||||||
CONST_EXPR,
|
|
||||||
looseIdentical
|
|
||||||
} from 'angular2/src/facade/lang';
|
|
||||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||||
import {AppElement} from './element';
|
import {AppElement} from './element';
|
||||||
@ -60,7 +53,7 @@ function _flattenNestedViewRenderNodes(nodes: any[], renderNodes: any[]): any[]
|
|||||||
return renderNodes;
|
return renderNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EMPTY_ARR = CONST_EXPR([]);
|
const EMPTY_ARR = /*@ts2dart_const*/[];
|
||||||
|
|
||||||
export function ensureSlotCount(projectableNodes: any[][], expectedSlotCount: number): any[][] {
|
export function ensureSlotCount(projectableNodes: any[][], expectedSlotCount: number): any[][] {
|
||||||
var res;
|
var res;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {isPresent, CONST, CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {isPresent, CONST, Type} from 'angular2/src/facade/lang';
|
||||||
import {InjectableMetadata} from 'angular2/src/core/di/metadata';
|
import {InjectableMetadata} from 'angular2/src/core/di/metadata';
|
||||||
import {ChangeDetectionStrategy} from 'angular2/src/core/change_detection';
|
import {ChangeDetectionStrategy} from 'angular2/src/core/change_detection';
|
||||||
import {ViewEncapsulation} from 'angular2/src/core/metadata/view';
|
import {ViewEncapsulation} from 'angular2/src/core/metadata/view';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Type, isBlank, isPresent, assertionsEnabled, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {Type, isBlank, isPresent, assertionsEnabled} from 'angular2/src/facade/lang';
|
||||||
import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
|
import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
|
||||||
import {Console} from 'angular2/src/core/console';
|
import {Console} from 'angular2/src/core/console';
|
||||||
import {Reflector, reflector} from './reflection/reflection';
|
import {Reflector, reflector} from './reflection/reflection';
|
||||||
@ -13,9 +13,9 @@ function _reflector(): Reflector {
|
|||||||
/**
|
/**
|
||||||
* A default set of providers which should be included in any Angular platform.
|
* A default set of providers which should be included in any Angular platform.
|
||||||
*/
|
*/
|
||||||
export const PLATFORM_COMMON_PROVIDERS: Array<Type | Provider | any[]> = CONST_EXPR([
|
export const PLATFORM_COMMON_PROVIDERS: Array<Type | Provider | any[]> = /*@ts2dart_const*/ [
|
||||||
PLATFORM_CORE_PROVIDERS,
|
PLATFORM_CORE_PROVIDERS,
|
||||||
new Provider(Reflector, {useFactory: _reflector, deps: []}),
|
new Provider(Reflector, {useFactory: _reflector, deps: []},
|
||||||
new Provider(ReflectorReader, {useExisting: Reflector}),
|
new Provider(ReflectorReader, {useExisting: Reflector}),
|
||||||
TestabilityRegistry,
|
TestabilityRegistry,
|
||||||
Console
|
Console
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import {OpaqueToken} from "angular2/src/core/di";
|
import {OpaqueToken} from "angular2/src/core/di";
|
||||||
import {CONST_EXPR} from "angular2/src/facade/lang";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A token that can be provided when bootstraping an application to make an array of directives
|
* A token that can be provided when bootstraping an application to make an array of directives
|
||||||
@ -25,7 +24,8 @@ import {CONST_EXPR} from "angular2/src/facade/lang";
|
|||||||
* bootstrap(MyComponent, [provide(PLATFORM_DIRECTIVES, {useValue: [OtherDirective], multi:true})]);
|
* bootstrap(MyComponent, [provide(PLATFORM_DIRECTIVES, {useValue: [OtherDirective], multi:true})]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const PLATFORM_DIRECTIVES: OpaqueToken = CONST_EXPR(new OpaqueToken("Platform Directives"));
|
export const PLATFORM_DIRECTIVES: OpaqueToken =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken("Platform Directives");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A token that can be provided when bootstraping an application to make an array of pipes
|
* A token that can be provided when bootstraping an application to make an array of pipes
|
||||||
@ -50,4 +50,4 @@ export const PLATFORM_DIRECTIVES: OpaqueToken = CONST_EXPR(new OpaqueToken("Plat
|
|||||||
* bootstrap(MyComponent, [provide(PLATFORM_PIPES, {useValue: [OtherPipe], multi:true})]);
|
* bootstrap(MyComponent, [provide(PLATFORM_PIPES, {useValue: [OtherPipe], multi:true})]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const PLATFORM_PIPES: OpaqueToken = CONST_EXPR(new OpaqueToken("Platform Pipes"));
|
export const PLATFORM_PIPES: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken("Platform Pipes");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {Injectable} from 'angular2/src/core/di';
|
import {Injectable} from 'angular2/src/core/di';
|
||||||
import {Map, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
import {Map, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
||||||
import {CONST, CONST_EXPR, scheduleMicroTask} from 'angular2/src/facade/lang';
|
import {CONST, scheduleMicroTask} from 'angular2/src/facade/lang';
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||||
import {NgZone} from '../zone/ng_zone';
|
import {NgZone} from '../zone/ng_zone';
|
||||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||||
@ -150,4 +150,4 @@ export function setTestabilityGetter(getter: GetTestability): void {
|
|||||||
_testabilityGetter = getter;
|
_testabilityGetter = getter;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _testabilityGetter: GetTestability = CONST_EXPR(new _NoopGetTestability());
|
var _testabilityGetter: GetTestability = /*@ts2dart_const*/ new _NoopGetTestability();
|
||||||
|
@ -106,12 +106,6 @@ _global.assert = function assert(condition) {
|
|||||||
// TODO: to be fixed properly via #2830, noop for now
|
// TODO: to be fixed properly via #2830, noop for now
|
||||||
};
|
};
|
||||||
|
|
||||||
// This function is needed only to properly support Dart's const expressions
|
|
||||||
// see https://github.com/angular/ts2dart/pull/151 for more info
|
|
||||||
export function CONST_EXPR<T>(expr: T): T {
|
|
||||||
return expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function CONST(): ClassDecorator & PropertyDecorator {
|
export function CONST(): ClassDecorator & PropertyDecorator {
|
||||||
return (target) => target;
|
return (target) => target;
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,7 @@ import {RequestMethod} from './enums';
|
|||||||
import {RequestArgs} from './interfaces';
|
import {RequestArgs} from './interfaces';
|
||||||
import {Headers} from './headers';
|
import {Headers} from './headers';
|
||||||
import {normalizeMethodName} from './http_utils';
|
import {normalizeMethodName} from './http_utils';
|
||||||
import {
|
import {RegExpWrapper, isPresent, isJsObject, StringWrapper} from 'angular2/src/facade/lang';
|
||||||
RegExpWrapper,
|
|
||||||
CONST_EXPR,
|
|
||||||
isPresent,
|
|
||||||
isJsObject,
|
|
||||||
StringWrapper
|
|
||||||
} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
// TODO(jeffbcross): properly implement body accessors
|
// TODO(jeffbcross): properly implement body accessors
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {ResponseType} from './enums';
|
import {ResponseType} from './enums';
|
||||||
import {CONST_EXPR, isString, isPresent, Json} from 'angular2/src/facade/lang';
|
import {isString, isPresent, Json} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
import {Headers} from './headers';
|
import {Headers} from './headers';
|
||||||
import {ResponseOptions} from './base_response_options';
|
import {ResponseOptions} from './base_response_options';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, isPresent, isBlank} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank} from 'angular2/src/facade/lang';
|
||||||
import {Map, MapWrapper, ListWrapper, isListLikeIterable} from 'angular2/src/facade/collection';
|
import {Map, MapWrapper, ListWrapper, isListLikeIterable} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
function paramParser(rawParams: string = ''): Map<string, string[]> {
|
function paramParser(rawParams: string = ''): Map<string, string[]> {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {OpaqueToken} from 'angular2/core';
|
import {OpaqueToken} from 'angular2/core';
|
||||||
import {UrlChangeListener} from './platform_location';
|
import {UrlChangeListener} from './platform_location';
|
||||||
|
|
||||||
@ -59,4 +58,4 @@ export abstract class LocationStrategy {
|
|||||||
* ]);
|
* ]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHref'));
|
export const APP_BASE_HREF: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('appBaseHref');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Map, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
import {Map, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
||||||
import {CONST, CONST_EXPR, global, isPresent} from 'angular2/src/facade/lang';
|
import {CONST, global, isPresent} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
import {PromiseWrapper, ObservableWrapper} from 'angular2/src/facade/async';
|
import {PromiseWrapper, ObservableWrapper} from 'angular2/src/facade/async';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, IS_DART} from 'angular2/src/facade/lang';
|
import {IS_DART} from 'angular2/src/facade/lang';
|
||||||
import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
|
import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
|
||||||
import {XHR} from 'angular2/src/compiler/xhr';
|
import {XHR} from 'angular2/src/compiler/xhr';
|
||||||
import {
|
import {
|
||||||
@ -46,15 +46,16 @@ export {BrowserDomAdapter} from './browser/browser_adapter';
|
|||||||
export {enableDebugTools, disableDebugTools} from 'angular2/src/platform/browser/tools/tools';
|
export {enableDebugTools, disableDebugTools} from 'angular2/src/platform/browser/tools/tools';
|
||||||
export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './dom/events/hammer_gestures';
|
export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './dom/events/hammer_gestures';
|
||||||
|
|
||||||
export const BROWSER_PLATFORM_MARKER = CONST_EXPR(new OpaqueToken('BrowserPlatformMarker'));
|
export const BROWSER_PLATFORM_MARKER =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken('BrowserPlatformMarker');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of providers to initialize the Angular platform in a web browser.
|
* A set of providers to initialize the Angular platform in a web browser.
|
||||||
*
|
*
|
||||||
* Used automatically by `bootstrap`, or can be passed to {@link platform}.
|
* Used automatically by `bootstrap`, or can be passed to {@link platform}.
|
||||||
*/
|
*/
|
||||||
export const BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/ [
|
||||||
new Provider(BROWSER_PLATFORM_MARKER, {useValue: true}),
|
new Provider(BROWSER_PLATFORM_MARKER, {useValue: true},
|
||||||
PLATFORM_COMMON_PROVIDERS,
|
PLATFORM_COMMON_PROVIDERS,
|
||||||
new Provider(PLATFORM_INITIALIZER, {useValue: initDomAdapter, multi: true}),
|
new Provider(PLATFORM_INITIALIZER, {useValue: initDomAdapter, multi: true}),
|
||||||
]);
|
]);
|
||||||
@ -74,10 +75,11 @@ function _document(): any {
|
|||||||
*
|
*
|
||||||
* Used automatically by `bootstrap`, or can be passed to {@link PlatformRef.application}.
|
* Used automatically by `bootstrap`, or can be passed to {@link PlatformRef.application}.
|
||||||
*/
|
*/
|
||||||
export const BROWSER_APP_COMMON_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const BROWSER_APP_COMMON_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
|
/*@ts2dart_const*/ [
|
||||||
APPLICATION_COMMON_PROVIDERS,
|
APPLICATION_COMMON_PROVIDERS,
|
||||||
FORM_PROVIDERS,
|
FORM_PROVIDERS,
|
||||||
new Provider(PLATFORM_PIPES, {useValue: COMMON_PIPES, multi: true}),
|
new Provider(PLATFORM_PIPES, {useValue: COMMON_PIPES, multi: true},
|
||||||
new Provider(PLATFORM_DIRECTIVES, {useValue: COMMON_DIRECTIVES, multi: true}),
|
new Provider(PLATFORM_DIRECTIVES, {useValue: COMMON_DIRECTIVES, multi: true}),
|
||||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||||
new Provider(DOCUMENT, {useFactory: _document, deps: []}),
|
new Provider(DOCUMENT, {useFactory: _document, deps: []}),
|
||||||
@ -94,10 +96,10 @@ export const BROWSER_APP_COMMON_PROVIDERS: Array<any /*Type | Provider | any[]*/
|
|||||||
AnimationBuilder,
|
AnimationBuilder,
|
||||||
EventManager,
|
EventManager,
|
||||||
ELEMENT_PROBE_PROVIDERS
|
ELEMENT_PROBE_PROVIDERS
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
|
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([new Provider(XHR, {useClass: CachedXHR})]);
|
/*@ts2dart_const*/ [new Provider(XHR, {useClass: CachedXHR}]);
|
||||||
|
|
||||||
export function initDomAdapter() {
|
export function initDomAdapter() {
|
||||||
BrowserDomAdapter.makeCurrent();
|
BrowserDomAdapter.makeCurrent();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, assertionsEnabled, isPresent} from 'angular2/src/facade/lang';
|
import {assertionsEnabled, isPresent} from 'angular2/src/facade/lang';
|
||||||
import {Injectable, provide, Provider} from 'angular2/src/core/di';
|
import {Injectable, provide, Provider} from 'angular2/src/core/di';
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||||
import {DebugNode, getDebugNode} from 'angular2/src/core/debug/debug_node';
|
import {DebugNode, getDebugNode} from 'angular2/src/core/debug/debug_node';
|
||||||
@ -6,7 +6,7 @@ import {DomRootRenderer} from 'angular2/src/platform/dom/dom_renderer';
|
|||||||
import {RootRenderer, NgZone, ApplicationRef} from 'angular2/core';
|
import {RootRenderer, NgZone, ApplicationRef} from 'angular2/core';
|
||||||
import {DebugDomRootRenderer} from 'angular2/src/core/debug/debug_renderer';
|
import {DebugDomRootRenderer} from 'angular2/src/core/debug/debug_renderer';
|
||||||
|
|
||||||
const CORE_TOKENS = CONST_EXPR({'ApplicationRef': ApplicationRef, 'NgZone': NgZone});
|
const CORE_TOKENS = /*@ts2dart_const*/ {'ApplicationRef': ApplicationRef, 'NgZone': NgZone};
|
||||||
|
|
||||||
const INSPECT_GLOBAL_NAME = 'ng.probe';
|
const INSPECT_GLOBAL_NAME = 'ng.probe';
|
||||||
const CORE_TOKENS_GLOBAL_NAME = 'ng.coreTokens';
|
const CORE_TOKENS_GLOBAL_NAME = 'ng.coreTokens';
|
||||||
@ -36,10 +36,10 @@ function _createRootRenderer(rootRenderer) {
|
|||||||
/**
|
/**
|
||||||
* Providers which support debugging Angular applications (e.g. via `ng.probe`).
|
* Providers which support debugging Angular applications (e.g. via `ng.probe`).
|
||||||
*/
|
*/
|
||||||
export const ELEMENT_PROBE_PROVIDERS: any[] = CONST_EXPR([
|
export const ELEMENT_PROBE_PROVIDERS: any[] = /*@ts2dart_const*/ [
|
||||||
new Provider(RootRenderer,
|
new Provider(RootRenderer,
|
||||||
{useFactory: _createConditionalRootRenderer, deps: [DomRootRenderer]})
|
{useFactory: _createConditionalRootRenderer, deps: [DomRootRenderer]}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const ELEMENT_PROBE_PROVIDERS_PROD_MODE: any[] = CONST_EXPR(
|
export const ELEMENT_PROBE_PROVIDERS_PROD_MODE: any[] = /*@ts2dart_const*/
|
||||||
[new Provider(RootRenderer, {useFactory: _createRootRenderer, deps: [DomRootRenderer]})]);
|
[new Provider(RootRenderer, {useFactory: _createRootRenderer, deps: [DomRootRenderer]}]);
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
isBlank,
|
isBlank,
|
||||||
Json,
|
Json,
|
||||||
RegExpWrapper,
|
RegExpWrapper,
|
||||||
CONST_EXPR,
|
|
||||||
stringify,
|
stringify,
|
||||||
StringWrapper,
|
StringWrapper,
|
||||||
isArray,
|
isArray,
|
||||||
@ -30,7 +29,8 @@ import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
|||||||
import {camelCaseToDashCase} from './util';
|
import {camelCaseToDashCase} from './util';
|
||||||
|
|
||||||
const NAMESPACE_URIS =
|
const NAMESPACE_URIS =
|
||||||
CONST_EXPR({'xlink': 'http://www.w3.org/1999/xlink', 'svg': 'http://www.w3.org/2000/svg'});
|
/*@ts2dart_const*/
|
||||||
|
{'xlink': 'http://www.w3.org/1999/xlink', 'svg': 'http://www.w3.org/2000/svg'};
|
||||||
const TEMPLATE_COMMENT_TEXT = 'template bindings={}';
|
const TEMPLATE_COMMENT_TEXT = 'template bindings={}';
|
||||||
var TEMPLATE_BINDINGS_EXP = /^template bindings=(.*)$/g;
|
var TEMPLATE_BINDINGS_EXP = /^template bindings=(.*)$/g;
|
||||||
|
|
||||||
@ -304,8 +304,8 @@ function decoratePreventDefault(eventHandler: Function): Function {
|
|||||||
|
|
||||||
var COMPONENT_REGEX = /%COMP%/g;
|
var COMPONENT_REGEX = /%COMP%/g;
|
||||||
export const COMPONENT_VARIABLE = '%COMP%';
|
export const COMPONENT_VARIABLE = '%COMP%';
|
||||||
export const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
export const HOST_ATTR = /*@ts2dart_const*/ `_nghost-${COMPONENT_VARIABLE}`;
|
||||||
export const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
export const CONTENT_ATTR = /*@ts2dart_const*/ `_ngcontent-${COMPONENT_VARIABLE}`;
|
||||||
|
|
||||||
function _shimContentAttribute(componentShortId: string): string {
|
function _shimContentAttribute(componentShortId: string): string {
|
||||||
return StringWrapper.replaceAll(CONTENT_ATTR, COMPONENT_REGEX, componentShortId);
|
return StringWrapper.replaceAll(CONTENT_ATTR, COMPONENT_REGEX, componentShortId);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import {OpaqueToken} from 'angular2/src/core/di';
|
import {OpaqueToken} from 'angular2/src/core/di';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A DI Token representing the main rendering context. In a browser this is the DOM Document.
|
* A DI Token representing the main rendering context. In a browser this is the DOM Document.
|
||||||
@ -7,4 +6,4 @@ import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|||||||
* Note: Document might not be available in the Application Context when Application and Rendering
|
* Note: Document might not be available in the Application Context when Application and Rendering
|
||||||
* Contexts are not the same (e.g. when running the application into a Web Worker).
|
* Contexts are not the same (e.g. when running the application into a Web Worker).
|
||||||
*/
|
*/
|
||||||
export const DOCUMENT: OpaqueToken = CONST_EXPR(new OpaqueToken('DocumentToken'));
|
export const DOCUMENT: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('DocumentToken');
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
import {Injectable, Inject, OpaqueToken} from 'angular2/src/core/di';
|
import {Injectable, Inject, OpaqueToken} from 'angular2/src/core/di';
|
||||||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
export const EVENT_MANAGER_PLUGINS: OpaqueToken =
|
export const EVENT_MANAGER_PLUGINS: OpaqueToken =
|
||||||
CONST_EXPR(new OpaqueToken("EventManagerPlugins"));
|
/*@ts2dart_const*/ new OpaqueToken("EventManagerPlugins");
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EventManager {
|
export class EventManager {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import {HammerGesturesPluginCommon} from './hammer_common';
|
import {HammerGesturesPluginCommon} from './hammer_common';
|
||||||
import {isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
import {Injectable, Inject, OpaqueToken} from 'angular2/core';
|
import {Injectable, Inject, OpaqueToken} from 'angular2/core';
|
||||||
|
|
||||||
export const HAMMER_GESTURE_CONFIG: OpaqueToken =
|
export const HAMMER_GESTURE_CONFIG: OpaqueToken =
|
||||||
CONST_EXPR(new OpaqueToken("HammerGestureConfig"));
|
/*@ts2dart_const*/ new OpaqueToken("HammerGestureConfig");
|
||||||
|
|
||||||
export interface HammerInstance {
|
export interface HammerInstance {
|
||||||
on(eventName: string, callback: Function): void;
|
on(eventName: string, callback: Function): void;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||||
import {Type, CONST_EXPR, isPresent} from 'angular2/src/facade/lang';
|
import {Type, isPresent} from 'angular2/src/facade/lang';
|
||||||
import {Provider} from 'angular2/src/core/di';
|
import {Provider} from 'angular2/src/core/di';
|
||||||
import {Parse5DomAdapter} from 'angular2/src/platform/server/parse5_adapter';
|
import {Parse5DomAdapter} from 'angular2/src/platform/server/parse5_adapter';
|
||||||
import {
|
import {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import {XHR} from 'angular2/src/compiler/xhr';
|
import {XHR} from 'angular2/src/compiler/xhr';
|
||||||
import {WebWorkerXHRImpl} from 'angular2/src/web_workers/worker/xhr_impl';
|
import {WebWorkerXHRImpl} from 'angular2/src/web_workers/worker/xhr_impl';
|
||||||
import {WebWorkerRootRenderer} from 'angular2/src/web_workers/worker/renderer';
|
import {WebWorkerRootRenderer} from 'angular2/src/web_workers/worker/renderer';
|
||||||
import {print, Type, CONST_EXPR, isPresent} from 'angular2/src/facade/lang';
|
import {print, Type, isPresent} from 'angular2/src/facade/lang';
|
||||||
import {RootRenderer} from 'angular2/src/core/render/api';
|
import {RootRenderer} from 'angular2/src/core/render/api';
|
||||||
import {
|
import {
|
||||||
PLATFORM_DIRECTIVES,
|
PLATFORM_DIRECTIVES,
|
||||||
@ -32,14 +32,14 @@ class PrintLogger {
|
|||||||
logGroupEnd() {}
|
logGroupEnd() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WORKER_APP_PLATFORM_MARKER = CONST_EXPR(new OpaqueToken('WorkerAppPlatformMarker'));
|
export const WORKER_APP_PLATFORM_MARKER =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken('WorkerAppPlatformMarker');
|
||||||
|
|
||||||
export const WORKER_APP_PLATFORM: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const WORKER_APP_PLATFORM: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/
|
||||||
PLATFORM_COMMON_PROVIDERS,
|
[PLATFORM_COMMON_PROVIDERS, new Provider(WORKER_APP_PLATFORM_MARKER, {useValue: true})];
|
||||||
CONST_EXPR(new Provider(WORKER_APP_PLATFORM_MARKER, {useValue: true}))
|
|
||||||
]);
|
|
||||||
|
|
||||||
export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> =
|
||||||
|
/*@ts2dart_const*/[
|
||||||
APPLICATION_COMMON_PROVIDERS,
|
APPLICATION_COMMON_PROVIDERS,
|
||||||
FORM_PROVIDERS,
|
FORM_PROVIDERS,
|
||||||
Serializer,
|
Serializer,
|
||||||
@ -54,7 +54,7 @@ export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*
|
|||||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||||
WebWorkerXHRImpl,
|
WebWorkerXHRImpl,
|
||||||
new Provider(XHR, {useExisting: WebWorkerXHRImpl})
|
new Provider(XHR, {useExisting: WebWorkerXHRImpl})
|
||||||
]);
|
];
|
||||||
|
|
||||||
function _exceptionHandler(): ExceptionHandler {
|
function _exceptionHandler(): ExceptionHandler {
|
||||||
return new ExceptionHandler(new PrintLogger());
|
return new ExceptionHandler(new PrintLogger());
|
||||||
|
@ -15,7 +15,6 @@ import {
|
|||||||
initializeGenericWorkerRenderer
|
initializeGenericWorkerRenderer
|
||||||
} from 'angular2/src/platform/worker_render_common';
|
} from 'angular2/src/platform/worker_render_common';
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper class that exposes the Worker
|
* Wrapper class that exposes the Worker
|
||||||
@ -36,17 +35,19 @@ export class WebWorkerInstance {
|
|||||||
/**
|
/**
|
||||||
* An array of providers that should be passed into `application()` when initializing a new Worker.
|
* An array of providers that should be passed into `application()` when initializing a new Worker.
|
||||||
*/
|
*/
|
||||||
export const WORKER_RENDER_APPLICATION: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const WORKER_RENDER_APPLICATION: Array<any /*Type | Provider | any[]*/> =
|
||||||
|
/*@ts2dart_const*/ [
|
||||||
WORKER_RENDER_APPLICATION_COMMON,
|
WORKER_RENDER_APPLICATION_COMMON,
|
||||||
WebWorkerInstance,
|
WebWorkerInstance,
|
||||||
new Provider(APP_INITIALIZER,
|
new Provider(APP_INITIALIZER,
|
||||||
{
|
{
|
||||||
useFactory: (injector) => () => initWebWorkerApplication(injector),
|
useFactory: (injector => () => initWebWorkerApplication(injector),
|
||||||
multi: true,
|
multi: true,
|
||||||
deps: [Injector]
|
deps: [Injector]
|
||||||
}),
|
}),
|
||||||
new Provider(MessageBus, {useFactory: (instance) => instance.bus, deps: [WebWorkerInstance]})
|
new Provider(MessageBus,
|
||||||
]);
|
{useFactory: (instance) => instance.bus, deps: [WebWorkerInstance]})
|
||||||
|
]);
|
||||||
|
|
||||||
function initWebWorkerApplication(injector: Injector): void {
|
function initWebWorkerApplication(injector: Injector): void {
|
||||||
var scriptUri: string;
|
var scriptUri: string;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, IS_DART} from 'angular2/src/facade/lang';
|
import {IS_DART} from 'angular2/src/facade/lang';
|
||||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||||
import {
|
import {
|
||||||
@ -53,29 +53,30 @@ import {
|
|||||||
HammerGesturesPlugin
|
HammerGesturesPlugin
|
||||||
} from 'angular2/src/platform/dom/events/hammer_gestures';
|
} from 'angular2/src/platform/dom/events/hammer_gestures';
|
||||||
|
|
||||||
export const WORKER_SCRIPT: OpaqueToken = CONST_EXPR(new OpaqueToken("WebWorkerScript"));
|
export const WORKER_SCRIPT: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken("WebWorkerScript");
|
||||||
|
|
||||||
// Message based Worker classes that listen on the MessageBus
|
// Message based Worker classes that listen on the MessageBus
|
||||||
export const WORKER_RENDER_MESSAGING_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const WORKER_RENDER_MESSAGING_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([MessageBasedRenderer, MessageBasedXHRImpl]);
|
/*@ts2dart_const*/[MessageBasedRenderer, MessageBasedXHRImpl];
|
||||||
|
|
||||||
export const WORKER_RENDER_PLATFORM_MARKER =
|
export const WORKER_RENDER_PLATFORM_MARKER =
|
||||||
CONST_EXPR(new OpaqueToken('WorkerRenderPlatformMarker'));
|
/*@ts2dart_const*/ new OpaqueToken('WorkerRenderPlatformMarker');
|
||||||
|
|
||||||
export const WORKER_RENDER_PLATFORM: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const WORKER_RENDER_PLATFORM: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/[
|
||||||
PLATFORM_COMMON_PROVIDERS,
|
PLATFORM_COMMON_PROVIDERS,
|
||||||
CONST_EXPR(new Provider(WORKER_RENDER_PLATFORM_MARKER, {useValue: true})),
|
new Provider(WORKER_RENDER_PLATFORM_MARKER, {useValue: true}),
|
||||||
new Provider(PLATFORM_INITIALIZER, {useValue: initWebWorkerRenderPlatform, multi: true})
|
new Provider(PLATFORM_INITIALIZER, {useValue: initWebWorkerRenderPlatform, multi: true})
|
||||||
]);
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of {@link Provider}s. To use the router in a Worker enabled application you must
|
* A list of {@link Provider}s. To use the router in a Worker enabled application you must
|
||||||
* include these providers when setting up the render thread.
|
* include these providers when setting up the render thread.
|
||||||
*/
|
*/
|
||||||
export const WORKER_RENDER_ROUTER: Array<any /*Type | Provider | any[]*/> =
|
export const WORKER_RENDER_ROUTER: Array<any /*Type | Provider | any[]*/> =
|
||||||
CONST_EXPR([BrowserPlatformLocation]);
|
/*@ts2dart_const*/[BrowserPlatformLocation];
|
||||||
|
|
||||||
export const WORKER_RENDER_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
export const WORKER_RENDER_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> =
|
||||||
|
/*@ts2dart_const*/[
|
||||||
APPLICATION_COMMON_PROVIDERS,
|
APPLICATION_COMMON_PROVIDERS,
|
||||||
WORKER_RENDER_MESSAGING_PROVIDERS,
|
WORKER_RENDER_MESSAGING_PROVIDERS,
|
||||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||||
@ -101,7 +102,7 @@ export const WORKER_RENDER_APPLICATION_COMMON: Array<any /*Type | Provider | any
|
|||||||
BrowserDetails,
|
BrowserDetails,
|
||||||
AnimationBuilder,
|
AnimationBuilder,
|
||||||
EventManager
|
EventManager
|
||||||
]);
|
];
|
||||||
|
|
||||||
export function initializeGenericWorkerRenderer(injector: Injector) {
|
export function initializeGenericWorkerRenderer(injector: Injector) {
|
||||||
var bus = injector.get(MessageBus);
|
var bus = injector.get(MessageBus);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Map, MapWrapper, StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
import {Map, MapWrapper, StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
||||||
import {isPresent, isBlank, normalizeBlank, Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank, normalizeBlank, Type} from 'angular2/src/facade/lang';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/async';
|
import {PromiseWrapper} from 'angular2/src/facade/async';
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ export class RouteParams {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export class RouteData {
|
export class RouteData {
|
||||||
constructor(public data: {[key: string]: any} = CONST_EXPR({})) {}
|
constructor(public data: {[key: string]: any} = /*@ts2dart_const*/ {}) {}
|
||||||
|
|
||||||
get(key: string): any { return normalizeBlank(StringMapWrapper.get(this.data, key)); }
|
get(key: string): any { return normalizeBlank(StringMapWrapper.get(this.data, key)); }
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ export class DefaultInstruction extends ResolvedInstruction {
|
|||||||
*/
|
*/
|
||||||
export class UnresolvedInstruction extends Instruction {
|
export class UnresolvedInstruction extends Instruction {
|
||||||
constructor(private _resolver: () => Promise<Instruction>, private _urlPath: string = '',
|
constructor(private _resolver: () => Promise<Instruction>, private _urlPath: string = '',
|
||||||
private _urlParams: string[] = CONST_EXPR([])) {
|
private _urlParams: string[] = /*@ts2dart_const*/[]) {
|
||||||
super(null, null, {});
|
super(null, null, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {CONST} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
@CONST()
|
@CONST()
|
||||||
export class RouteLifecycleHook {
|
export class RouteLifecycleHook {
|
||||||
@ -11,12 +11,12 @@ export class CanActivate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const routerCanReuse: RouteLifecycleHook =
|
export const routerCanReuse: RouteLifecycleHook =
|
||||||
CONST_EXPR(new RouteLifecycleHook("routerCanReuse"));
|
/*@ts2dart_const*/ new RouteLifecycleHook("routerCanReuse");
|
||||||
export const routerCanDeactivate: RouteLifecycleHook =
|
export const routerCanDeactivate: RouteLifecycleHook =
|
||||||
CONST_EXPR(new RouteLifecycleHook("routerCanDeactivate"));
|
/*@ts2dart_const*/ new RouteLifecycleHook("routerCanDeactivate");
|
||||||
export const routerOnActivate: RouteLifecycleHook =
|
export const routerOnActivate: RouteLifecycleHook =
|
||||||
CONST_EXPR(new RouteLifecycleHook("routerOnActivate"));
|
/*@ts2dart_const*/ new RouteLifecycleHook("routerOnActivate");
|
||||||
export const routerOnReuse: RouteLifecycleHook =
|
export const routerOnReuse: RouteLifecycleHook =
|
||||||
CONST_EXPR(new RouteLifecycleHook("routerOnReuse"));
|
/*@ts2dart_const*/ new RouteLifecycleHook("routerOnReuse");
|
||||||
export const routerOnDeactivate: RouteLifecycleHook =
|
export const routerOnDeactivate: RouteLifecycleHook =
|
||||||
CONST_EXPR(new RouteLifecycleHook("routerOnDeactivate"));
|
/*@ts2dart_const*/ new RouteLifecycleHook("routerOnDeactivate");
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
StringWrapper,
|
StringWrapper,
|
||||||
Math,
|
Math,
|
||||||
getTypeNameForDebugging,
|
getTypeNameForDebugging,
|
||||||
CONST_EXPR
|
|
||||||
} from 'angular2/src/facade/lang';
|
} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||||
@ -77,7 +76,7 @@ var _resolveToNull = PromiseWrapper.resolve<Instruction>(null);
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const ROUTER_PRIMARY_COMPONENT: OpaqueToken =
|
export const ROUTER_PRIMARY_COMPONENT: OpaqueToken =
|
||||||
CONST_EXPR(new OpaqueToken('RouterPrimaryComponent'));
|
/*@ts2dart_const*/ new OpaqueToken('RouterPrimaryComponent');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
BrowserPlatformLocation
|
BrowserPlatformLocation
|
||||||
} from 'angular2/src/platform/browser/location/browser_platform_location';
|
} from 'angular2/src/platform/browser/location/browser_platform_location';
|
||||||
import {PlatformLocation} from 'angular2/platform/common';
|
import {PlatformLocation} from 'angular2/platform/common';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of {@link Provider}s. To use the router, you must add this to your application.
|
* A list of {@link Provider}s. To use the router, you must add this to your application.
|
||||||
@ -30,14 +29,14 @@ import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|||||||
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const ROUTER_PROVIDERS: any[] = CONST_EXPR([
|
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
|
||||||
ROUTER_PROVIDERS_COMMON,
|
ROUTER_PROVIDERS_COMMON,
|
||||||
CONST_EXPR(new Provider(PlatformLocation, {useClass: BrowserPlatformLocation})),
|
new Provider(PlatformLocation, {useClass: BrowserPlatformLocation}),
|
||||||
]);
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use {@link ROUTER_PROVIDERS} instead.
|
* Use {@link ROUTER_PROVIDERS} instead.
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
export const ROUTER_BINDINGS = ROUTER_PROVIDERS;
|
export const ROUTER_BINDINGS = /*@ts2dart_const*/ ROUTER_PROVIDERS;
|
||||||
|
@ -1,27 +1,25 @@
|
|||||||
import {LocationStrategy, PathLocationStrategy, Location} from 'angular2/platform/common';
|
import {LocationStrategy, PathLocationStrategy, Location} from 'angular2/platform/common';
|
||||||
import {Router, RootRouter} from 'angular2/src/router/router';
|
import {Router, RootRouter} from 'angular2/src/router/router';
|
||||||
import {RouteRegistry, ROUTER_PRIMARY_COMPONENT} from 'angular2/src/router/route_registry';
|
import {RouteRegistry, ROUTER_PRIMARY_COMPONENT} from 'angular2/src/router/route_registry';
|
||||||
import {CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {Type} from 'angular2/src/facade/lang';
|
||||||
import {ApplicationRef, OpaqueToken, Provider} from 'angular2/core';
|
import {ApplicationRef, OpaqueToken, Provider} from 'angular2/core';
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Platform agnostic ROUTER PROVIDERS
|
* The Platform agnostic ROUTER PROVIDERS
|
||||||
*/
|
*/
|
||||||
export const ROUTER_PROVIDERS_COMMON: any[] = CONST_EXPR([
|
export const ROUTER_PROVIDERS_COMMON: any[] = /*@ts2dart_const*/[
|
||||||
RouteRegistry,
|
RouteRegistry,
|
||||||
CONST_EXPR(new Provider(LocationStrategy, {useClass: PathLocationStrategy})),
|
new Provider(LocationStrategy, {useClass: PathLocationStrategy}),
|
||||||
Location,
|
Location,
|
||||||
CONST_EXPR(new Provider(
|
new Provider(Router,
|
||||||
Router,
|
|
||||||
{
|
{
|
||||||
useFactory: routerFactory,
|
useFactory: routerFactory,
|
||||||
deps: CONST_EXPR([RouteRegistry, Location, ROUTER_PRIMARY_COMPONENT, ApplicationRef])
|
deps: [RouteRegistry, Location, ROUTER_PRIMARY_COMPONENT, ApplicationRef]
|
||||||
})),
|
}),
|
||||||
CONST_EXPR(new Provider(
|
new Provider(ROUTER_PRIMARY_COMPONENT,
|
||||||
ROUTER_PRIMARY_COMPONENT,
|
{useFactory: routerPrimaryComponentFactory, deps: [ApplicationRef]})
|
||||||
{useFactory: routerPrimaryComponentFactory, deps: CONST_EXPR([ApplicationRef])}))
|
];
|
||||||
]);
|
|
||||||
|
|
||||||
function routerFactory(registry: RouteRegistry, location: Location, primaryComponent: Type,
|
function routerFactory(registry: RouteRegistry, location: Location, primaryComponent: Type,
|
||||||
appRef: ApplicationRef): RootRouter {
|
appRef: ApplicationRef): RootRouter {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||||
import {isPresent, isBlank, RegExpWrapper, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank, RegExpWrapper} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
|
|
||||||
export function convertUrlParamsToArray(urlParams: {[key: string]: any}): string[] {
|
export function convertUrlParamsToArray(urlParams: {[key: string]: any}): string[] {
|
||||||
@ -22,8 +22,8 @@ export function serializeParams(urlParams: {[key: string]: any}, joiner = '&'):
|
|||||||
*/
|
*/
|
||||||
export class Url {
|
export class Url {
|
||||||
constructor(public path: string, public child: Url = null,
|
constructor(public path: string, public child: Url = null,
|
||||||
public auxiliary: Url[] = CONST_EXPR([]),
|
public auxiliary: Url[] = /*@ts2dart_const*/[],
|
||||||
public params: {[key: string]: any} = CONST_EXPR({})) {}
|
public params: {[key: string]: any} = /*@ts2dart_const*/ {}) {}
|
||||||
|
|
||||||
toString(): string {
|
toString(): string {
|
||||||
return this.path + this._matrixParamsToString() + this._auxToString() + this._childString();
|
return this.path + this._matrixParamsToString() + this._auxToString() + this._childString();
|
||||||
@ -51,7 +51,7 @@ export class Url {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class RootUrl extends Url {
|
export class RootUrl extends Url {
|
||||||
constructor(path: string, child: Url = null, auxiliary: Url[] = CONST_EXPR([]),
|
constructor(path: string, child: Url = null, auxiliary: Url[] = /*@ts2dart_const*/[],
|
||||||
params: {[key: string]: any} = null) {
|
params: {[key: string]: any} = null) {
|
||||||
super(path, child, auxiliary, params);
|
super(path, child, auxiliary, params);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import {CONST_EXPR} from "angular2/src/facade/lang";
|
|
||||||
import {OpaqueToken} from "angular2/src/core/di";
|
import {OpaqueToken} from "angular2/src/core/di";
|
||||||
|
|
||||||
export const ON_WEB_WORKER = CONST_EXPR(new OpaqueToken('WebWorker.onWebWorker'));
|
export const ON_WEB_WORKER = /*@ts2dart_const*/ new OpaqueToken('WebWorker.onWebWorker');
|
||||||
|
@ -10,7 +10,7 @@ import {LocationType} from './serialized_types';
|
|||||||
|
|
||||||
// PRIMITIVE is any type that does not need to be serialized (string, number, boolean)
|
// PRIMITIVE is any type that does not need to be serialized (string, number, boolean)
|
||||||
// We set it to String so that it is considered a Type.
|
// We set it to String so that it is considered a Type.
|
||||||
export const PRIMITIVE: Type = String;
|
export const PRIMITIVE: Type = /*@ts2dart_const*/ String;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Serializer {
|
export class Serializer {
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
import {MessageBasedPlatformLocation} from './platform_location';
|
import {MessageBasedPlatformLocation} from './platform_location';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {
|
import {
|
||||||
BrowserPlatformLocation
|
BrowserPlatformLocation
|
||||||
} from 'angular2/src/platform/browser/location/browser_platform_location';
|
} from 'angular2/src/platform/browser/location/browser_platform_location';
|
||||||
import {APP_INITIALIZER, Provider, Injector, NgZone} from 'angular2/core';
|
import {APP_INITIALIZER, Provider, Injector, NgZone} from 'angular2/core';
|
||||||
|
|
||||||
export const WORKER_RENDER_ROUTER = CONST_EXPR([
|
export const WORKER_RENDER_ROUTER = /*@ts2dart_const*/[
|
||||||
MessageBasedPlatformLocation,
|
MessageBasedPlatformLocation,
|
||||||
BrowserPlatformLocation,
|
BrowserPlatformLocation,
|
||||||
CONST_EXPR(
|
new Provider(APP_INITIALIZER, {useFactory: initRouterListeners, multi: true, deps: [Injector]})
|
||||||
new Provider(APP_INITIALIZER,
|
];
|
||||||
{useFactory: initRouterListeners, multi: true, deps: CONST_EXPR([Injector])}))
|
|
||||||
]);
|
|
||||||
|
|
||||||
function initRouterListeners(injector: Injector): () => void {
|
function initRouterListeners(injector: Injector): () => void {
|
||||||
return () => {
|
return () => {
|
||||||
|
@ -46,7 +46,6 @@ import {
|
|||||||
import {By} from 'angular2/platform/browser';
|
import {By} from 'angular2/platform/browser';
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
import {ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
import {ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {PromiseWrapper} from "angular2/src/facade/promise";
|
import {PromiseWrapper} from "angular2/src/facade/promise";
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
|
@ -14,12 +14,12 @@ import {
|
|||||||
inject
|
inject
|
||||||
} from 'angular2/testing_internal';
|
} from 'angular2/testing_internal';
|
||||||
import {ControlGroup, Control, ControlArray, Validators} from 'angular2/common';
|
import {ControlGroup, Control, ControlArray, Validators} from 'angular2/common';
|
||||||
import {IS_DART, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {IS_DART, isPresent} from 'angular2/src/facade/lang';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
||||||
import {TimerWrapper, ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
import {TimerWrapper, ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
function asyncValidator(expected, timeouts = CONST_EXPR({})) {
|
function asyncValidator(expected, timeouts = /*@ts2dart_const*/ {}) {
|
||||||
return (c) => {
|
return (c) => {
|
||||||
var completer = PromiseWrapper.completer();
|
var completer = PromiseWrapper.completer();
|
||||||
var t = isPresent(timeouts[c.value]) ? timeouts[c.value] : 0;
|
var t = isPresent(timeouts[c.value]) ? timeouts[c.value] : 0;
|
||||||
|
@ -14,7 +14,6 @@ import {
|
|||||||
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from 'angular2/common';
|
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from 'angular2/common';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
||||||
import {EventEmitter, ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
import {EventEmitter, ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
function validator(key: string, error: any) {
|
function validator(key: string, error: any) {
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
export const styles = CONST_EXPR([`.greenStyle[_ngcontent-a-1] { color: green; }`]);
|
export const styles = /*@ts2dart_const*/[`.greenStyle[_ngcontent-a-1] { color: green; }`];
|
||||||
|
@ -14,7 +14,7 @@ import {provide} from 'angular2/src/core/di';
|
|||||||
import {Console} from 'angular2/src/core/console';
|
import {Console} from 'angular2/src/core/console';
|
||||||
|
|
||||||
import {TEST_PROVIDERS} from './test_bindings';
|
import {TEST_PROVIDERS} from './test_bindings';
|
||||||
import {isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent} from 'angular2/src/facade/lang';
|
||||||
import {
|
import {
|
||||||
TemplateParser,
|
TemplateParser,
|
||||||
splitClasses,
|
splitClasses,
|
||||||
@ -506,8 +506,8 @@ export function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createProvider(
|
function createProvider(
|
||||||
token: string, {multi = false, deps = CONST_EXPR([])}:
|
token: string, {multi = false, deps = /*@ts2dart_const*/[
|
||||||
{multi?: boolean, deps?: string[]} = {}): CompileProviderMetadata {
|
]}: {multi?: boolean, deps?: string[]} = {}): CompileProviderMetadata {
|
||||||
return new CompileProviderMetadata({
|
return new CompileProviderMetadata({
|
||||||
token: createToken(token),
|
token: createToken(token),
|
||||||
multi: multi,
|
multi: multi,
|
||||||
@ -516,8 +516,9 @@ export function main() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDir(selector: string, {providers = null, viewProviders = null,
|
function createDir(selector: string,
|
||||||
deps = CONST_EXPR([]), queries = CONST_EXPR([])}: {
|
{providers = null, viewProviders = null, deps = /*@ts2dart_const*/[],
|
||||||
|
queries = /*@ts2dart_const*/[]}: {
|
||||||
providers?: CompileProviderMetadata[],
|
providers?: CompileProviderMetadata[],
|
||||||
viewProviders?: CompileProviderMetadata[],
|
viewProviders?: CompileProviderMetadata[],
|
||||||
deps?: string[],
|
deps?: string[],
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import {isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isBlank} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
export function iterableChangesAsString(
|
export function iterableChangesAsString(
|
||||||
{collection = CONST_EXPR([]), previous = CONST_EXPR([]), additions = CONST_EXPR([]),
|
{collection = /*@ts2dart_const*/[], previous = /*@ts2dart_const*/[],
|
||||||
moves = CONST_EXPR([]), removals = CONST_EXPR([]), identityChanges = CONST_EXPR([])}) {
|
additions = /*@ts2dart_const*/[], moves = /*@ts2dart_const*/[],
|
||||||
|
removals = /*@ts2dart_const*/[], identityChanges = /*@ts2dart_const*/[]}) {
|
||||||
return "collection: " + collection.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" +
|
return "collection: " + collection.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" +
|
||||||
"additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" +
|
"additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" +
|
||||||
"removals: " + removals.join(', ') + "\n" + "identityChanges: " +
|
"removals: " + removals.join(', ') + "\n" + "identityChanges: " +
|
||||||
|
@ -17,7 +17,6 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
IS_DART,
|
IS_DART,
|
||||||
CONST_EXPR,
|
|
||||||
Type,
|
Type,
|
||||||
isPresent,
|
isPresent,
|
||||||
isBlank,
|
isBlank,
|
||||||
@ -1072,8 +1071,8 @@ export function main() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const ALL_DIRECTIVES = CONST_EXPR([
|
const ALL_DIRECTIVES = /*@ts2dart_const*/ [
|
||||||
forwardRef(() => TestDirective),
|
forwardRef(( => TestDirective),
|
||||||
forwardRef(() => TestComponent),
|
forwardRef(() => TestComponent),
|
||||||
forwardRef(() => AnotherComponent),
|
forwardRef(() => AnotherComponent),
|
||||||
forwardRef(() => TestLocals),
|
forwardRef(() => TestLocals),
|
||||||
@ -1085,8 +1084,8 @@ const ALL_DIRECTIVES = CONST_EXPR([
|
|||||||
forwardRef(() => OrderCheckDirective1),
|
forwardRef(() => OrderCheckDirective1),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const ALL_PIPES = CONST_EXPR([
|
const ALL_PIPES = /*@ts2dart_const*/ [
|
||||||
forwardRef(() => CountingPipe),
|
forwardRef(( => CountingPipe),
|
||||||
forwardRef(() => CountingImpurePipe),
|
forwardRef(() => CountingImpurePipe),
|
||||||
forwardRef(() => MultiArgPipe),
|
forwardRef(() => MultiArgPipe),
|
||||||
forwardRef(() => PipeWithOnDestroy),
|
forwardRef(() => PipeWithOnDestroy),
|
||||||
|
@ -32,7 +32,6 @@ import {
|
|||||||
stringify,
|
stringify,
|
||||||
isBlank,
|
isBlank,
|
||||||
CONST,
|
CONST,
|
||||||
CONST_EXPR,
|
|
||||||
IS_DART
|
IS_DART
|
||||||
} from 'angular2/src/facade/lang';
|
} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
@ -93,7 +92,7 @@ import {TemplateRef_, TemplateRef} from 'angular2/src/core/linker/template_ref';
|
|||||||
|
|
||||||
import {Renderer} from 'angular2/src/core/render';
|
import {Renderer} from 'angular2/src/core/render';
|
||||||
|
|
||||||
const ANCHOR_ELEMENT = CONST_EXPR(new OpaqueToken('AnchorElement'));
|
const ANCHOR_ELEMENT = /*@ts2dart_const*/ new OpaqueToken('AnchorElement');
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
if (IS_DART) {
|
if (IS_DART) {
|
||||||
|
@ -17,7 +17,7 @@ import {
|
|||||||
fakeAsync,
|
fakeAsync,
|
||||||
tick
|
tick
|
||||||
} from 'angular2/testing_internal';
|
} from 'angular2/testing_internal';
|
||||||
import {isBlank, isPresent, stringify, Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isBlank, isPresent, stringify, Type} from 'angular2/src/facade/lang';
|
||||||
import {
|
import {
|
||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
@ -49,8 +49,8 @@ import {
|
|||||||
import {NgIf} from 'angular2/common';
|
import {NgIf} from 'angular2/common';
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||||
|
|
||||||
const ALL_DIRECTIVES = CONST_EXPR([
|
const ALL_DIRECTIVES = /*@ts2dart_const*/ [
|
||||||
forwardRef(() => SimpleDirective),
|
forwardRef(( => SimpleDirective),
|
||||||
forwardRef(() => CycleDirective),
|
forwardRef(() => CycleDirective),
|
||||||
forwardRef(() => SimpleComponent),
|
forwardRef(() => SimpleComponent),
|
||||||
forwardRef(() => SomeOtherDirective),
|
forwardRef(() => SomeOtherDirective),
|
||||||
@ -83,8 +83,8 @@ const ALL_DIRECTIVES = CONST_EXPR([
|
|||||||
NgIf
|
NgIf
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const ALL_PIPES = CONST_EXPR([
|
const ALL_PIPES = /*@ts2dart_const*/ [
|
||||||
forwardRef(() => PipeNeedsChangeDetectorRef),
|
forwardRef(( => PipeNeedsChangeDetectorRef),
|
||||||
forwardRef(() => PipeNeedsService),
|
forwardRef(() => PipeNeedsService),
|
||||||
forwardRef(() => PurePipe),
|
forwardRef(() => PurePipe),
|
||||||
forwardRef(() => ImpurePipe),
|
forwardRef(() => ImpurePipe),
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
RegExpWrapper,
|
RegExpWrapper,
|
||||||
RegExpMatcherWrapper,
|
RegExpMatcherWrapper,
|
||||||
StringWrapper,
|
StringWrapper,
|
||||||
CONST_EXPR,
|
|
||||||
hasConstructor,
|
hasConstructor,
|
||||||
resolveEnumToken
|
resolveEnumToken
|
||||||
} from 'angular2/src/facade/lang';
|
} from 'angular2/src/facade/lang';
|
||||||
@ -52,7 +51,7 @@ export function main() {
|
|||||||
|
|
||||||
describe('const', () => {
|
describe('const', () => {
|
||||||
it('should support const expressions both in TS and Dart', () => {
|
it('should support const expressions both in TS and Dart', () => {
|
||||||
const numbers = CONST_EXPR([1, 2, 3]);
|
const numbers = /*@ts2dart_const*/[1, 2, 3];
|
||||||
expect(numbers).toEqual([1, 2, 3]);
|
expect(numbers).toEqual([1, 2, 3]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
} from 'angular2/testing_internal';
|
} from 'angular2/testing_internal';
|
||||||
|
|
||||||
import {Injector, provide} from 'angular2/core';
|
import {Injector, provide} from 'angular2/core';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
import {parseRouterLinkExpression} from 'angular2/src/router/directives/router_link_transform';
|
import {parseRouterLinkExpression} from 'angular2/src/router/directives/router_link_transform';
|
||||||
import {Unparser} from '../../compiler/expression_parser/unparser';
|
import {Unparser} from '../../compiler/expression_parser/unparser';
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
} from 'angular2/testing_internal';
|
} from 'angular2/testing_internal';
|
||||||
|
|
||||||
import {Injector, provide, ReflectiveInjector} from 'angular2/core';
|
import {Injector, provide, ReflectiveInjector} from 'angular2/core';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
import {Location, LocationStrategy, APP_BASE_HREF} from 'angular2/platform/common';
|
import {Location, LocationStrategy, APP_BASE_HREF} from 'angular2/platform/common';
|
||||||
import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
|
import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
|
||||||
@ -22,7 +21,8 @@ export function main() {
|
|||||||
|
|
||||||
var locationStrategy, location;
|
var locationStrategy, location;
|
||||||
|
|
||||||
function makeLocation(baseHref: string = '/my/app', provider: any = CONST_EXPR([])): Location {
|
function makeLocation(baseHref: string = '/my/app',
|
||||||
|
provider: any = /*@ts2dart_const*/[]): Location {
|
||||||
locationStrategy = new MockLocationStrategy();
|
locationStrategy = new MockLocationStrategy();
|
||||||
locationStrategy.internalBaseHref = baseHref;
|
locationStrategy.internalBaseHref = baseHref;
|
||||||
let injector = ReflectiveInjector.resolveAndCreate(
|
let injector = ReflectiveInjector.resolveAndCreate(
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
} from 'angular2/testing_internal';
|
} from 'angular2/testing_internal';
|
||||||
|
|
||||||
import {Injector, provide} from 'angular2/core';
|
import {Injector, provide} from 'angular2/core';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
PlatformLocation,
|
PlatformLocation,
|
||||||
|
@ -19,7 +19,6 @@ import {
|
|||||||
import {UiArguments} from 'angular2/src/web_workers/shared/client_message_broker';
|
import {UiArguments} from 'angular2/src/web_workers/shared/client_message_broker';
|
||||||
import {Type} from 'angular2/src/facade/lang';
|
import {Type} from 'angular2/src/facade/lang';
|
||||||
import {PromiseWrapper} from "angular2/src/facade/async";
|
import {PromiseWrapper} from "angular2/src/facade/async";
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("WebWorkerPlatformLocation", () => {
|
describe("WebWorkerPlatformLocation", () => {
|
||||||
|
@ -2,8 +2,6 @@ import {bootstrap} from 'angular2/platform/browser';
|
|||||||
import {Component, Directive, Host, forwardRef, Provider, Injectable} from 'angular2/core';
|
import {Component, Directive, Host, forwardRef, Provider, Injectable} from 'angular2/core';
|
||||||
import {NgIf, NgFor, FORM_DIRECTIVES} from 'angular2/common';
|
import {NgIf, NgFor, FORM_DIRECTIVES} from 'angular2/common';
|
||||||
|
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can find the Angular 1 implementation of this example here:
|
* You can find the Angular 1 implementation of this example here:
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
NgForm
|
NgForm
|
||||||
} from 'angular2/common';
|
} from 'angular2/common';
|
||||||
|
|
||||||
import {RegExpWrapper, print, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {RegExpWrapper, print, isPresent} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A domain model we are binding the form controls to.
|
* A domain model we are binding the form controls to.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user