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 {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
|
||||
} 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 {
|
||||
BROWSER_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.
|
||||
*/
|
||||
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,
|
||||
COMPILER_PROVIDERS,
|
||||
new Provider(XHR, {useClass: XHRImpl}),
|
||||
new Provider(XHR, {useClass: XHRImpl},
|
||||
]);
|
||||
|
||||
export function browserPlatform(): PlatformRef {
|
||||
|
|
|
@ -33,7 +33,7 @@ import {
|
|||
* have been precompiled offline.
|
||||
*/
|
||||
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
BROWSER_APP_COMMON_PROVIDERS;
|
||||
/*@ts2dart_const*/ BROWSER_APP_COMMON_PROVIDERS;
|
||||
|
||||
export function browserStaticPlatform(): PlatformRef {
|
||||
if (isBlank(getPlatform())) {
|
||||
|
|
|
@ -3,7 +3,6 @@ import {
|
|||
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
||||
} from 'angular2/platform/testing/browser_static';
|
||||
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.
|
||||
|
@ -15,10 +14,10 @@ export {CACHED_TEMPLATE_PROVIDER} from 'angular2/platform/browser';
|
|||
* Default platform providers for testing.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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 {CONST_EXPR, IS_DART} from 'angular2/src/facade/lang';
|
||||
import {IS_DART} from 'angular2/src/facade/lang';
|
||||
|
||||
import {Log} from 'angular2/src/testing/utils';
|
||||
|
||||
|
@ -47,14 +47,14 @@ function createNgZone(): NgZone {
|
|||
* Default platform providers for testing without a compiler.
|
||||
*/
|
||||
export const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
CONST_EXPR([
|
||||
/*@ts2dart_const*/ [
|
||||
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[]*/> =
|
||||
CONST_EXPR([
|
||||
new Provider(APP_ID, {useValue: 'a'}),
|
||||
/*@ts2dart_const*/ [
|
||||
new Provider(APP_ID, {useValue: 'a'},
|
||||
ELEMENT_PROBE_PROVIDERS,
|
||||
new Provider(DirectiveResolver, {useClass: MockDirectiveResolver}),
|
||||
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.
|
||||
*/
|
||||
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
CONST_EXPR([
|
||||
/*@ts2dart_const*/ [
|
||||
BROWSER_APP_COMMON_PROVIDERS,
|
||||
new Provider(XHR, {useClass: XHRImpl}),
|
||||
new Provider(XHR, {useClass: XHRImpl},
|
||||
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
||||
]);
|
||||
|
|
|
@ -38,7 +38,6 @@ import {
|
|||
import {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';
|
||||
import {LocationStrategy} from 'angular2/platform/common';
|
||||
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
import {Log} from 'angular2/src/testing/utils';
|
||||
|
||||
|
@ -50,10 +49,11 @@ function initServerTests() {
|
|||
/**
|
||||
* Default platform providers for testing.
|
||||
*/
|
||||
export const TEST_SERVER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
||||
PLATFORM_COMMON_PROVIDERS,
|
||||
new Provider(PLATFORM_INITIALIZER, {useValue: initServerTests, multi: true})
|
||||
]);
|
||||
export const TEST_SERVER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
/*@ts2dart_const*/ [
|
||||
PLATFORM_COMMON_PROVIDERS,
|
||||
new Provider(PLATFORM_INITIALIZER, {useValue: initServerTests, multi: true}
|
||||
]);
|
||||
|
||||
function appDoc() {
|
||||
try {
|
||||
|
@ -67,8 +67,8 @@ function appDoc() {
|
|||
* Default application providers for testing.
|
||||
*/
|
||||
export const TEST_SERVER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
CONST_EXPR([
|
||||
// TODO(julie): when angular2/platform/server is available, use that instead of making our own
|
||||
/*@ts2dart_const*/ [
|
||||
// TODO(julie: when angular2/platform/server is available, use that instead of making our own
|
||||
// list here.
|
||||
APPLICATION_COMMON_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 {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
|
||||
|
@ -44,4 +43,4 @@ import {CONST_EXPR} from './src/facade/lang';
|
|||
* 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 {Provider} from 'angular2/core';
|
||||
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';
|
||||
|
||||
|
@ -32,4 +31,5 @@ export {RouterLinkTransform} from 'angular2/src/router/directives/router_link_tr
|
|||
* ```
|
||||
*/
|
||||
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 {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 {NgFor} from './ng_for';
|
||||
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,
|
||||
NgFor,
|
||||
NgIf,
|
||||
|
@ -58,4 +58,4 @@ export const CORE_DIRECTIVES: Type[] = CONST_EXPR([
|
|||
NgSwitchDefault,
|
||||
NgPlural,
|
||||
NgPluralCase
|
||||
]);
|
||||
];
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
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';
|
||||
|
||||
const _WHEN_DEFAULT = CONST_EXPR(new Object());
|
||||
const _WHEN_DEFAULT = /*@ts2dart_const*/ new Object();
|
||||
|
||||
export class SwitchView {
|
||||
constructor(private _viewContainerRef: ViewContainerRef,
|
||||
|
|
|
@ -43,7 +43,7 @@ export {
|
|||
export {FormBuilder} from './forms/form_builder';
|
||||
import {FormBuilder} from './forms/form_builder';
|
||||
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.
|
||||
|
@ -54,11 +54,11 @@ import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
|||
* 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.
|
||||
*
|
||||
* @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 {NgFormControl} from './directives/ng_form_control';
|
||||
import {NgModel} from './directives/ng_model';
|
||||
|
@ -64,7 +64,7 @@ export {ControlValueAccessor} from './directives/control_value_accessor';
|
|||
* class MyApp {}
|
||||
* ```
|
||||
*/
|
||||
export const FORM_DIRECTIVES: Type[] = CONST_EXPR([
|
||||
export const FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
||||
NgControlName,
|
||||
NgControlGroup,
|
||||
|
||||
|
@ -85,4 +85,4 @@ export const FORM_DIRECTIVES: Type[] = CONST_EXPR([
|
|||
MinLengthValidator,
|
||||
MaxLengthValidator,
|
||||
PatternValidator
|
||||
]);
|
||||
];
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import {Directive, Renderer, ElementRef, Self, forwardRef, Provider} from 'angular2/core';
|
||||
|
||||
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(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true}));
|
||||
export const CHECKBOX_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true});
|
||||
|
||||
/**
|
||||
* 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 {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
/**
|
||||
* A bridge between a control and a native element.
|
||||
|
@ -31,4 +30,5 @@ export interface ControlValueAccessor {
|
|||
*
|
||||
* 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 {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(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => DefaultValueAccessor), multi: true}));
|
||||
export const DEFAULT_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => DefaultValueAccessor), multi: true});
|
||||
|
||||
/**
|
||||
* The default accessor for writing a value and listening to changes that is used by the
|
||||
|
|
|
@ -10,7 +10,6 @@ import {
|
|||
Provider,
|
||||
Self
|
||||
} from 'angular2/core';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
import {ControlContainer} from './control_container';
|
||||
import {controlPath, composeValidators, composeAsyncValidators} from './shared';
|
||||
|
@ -20,7 +19,8 @@ import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
|||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||
|
||||
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.
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
|
||||
import {
|
||||
|
@ -32,7 +31,7 @@ import {ValidatorFn, AsyncValidatorFn} from './validators';
|
|||
|
||||
|
||||
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.
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
PromiseCompleter
|
||||
} from 'angular2/src/facade/async';
|
||||
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 {NgControl} from './ng_control';
|
||||
import {Form} from './form_interface';
|
||||
|
@ -15,8 +15,8 @@ import {AbstractControl, ControlGroup, Control} from '../model';
|
|||
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
|
||||
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
||||
|
||||
export const formDirectiveProvider =
|
||||
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgForm)}));
|
||||
const formDirectiveProvider =
|
||||
/*@ts2dart_const*/ new Provider(ControlContainer, {useExisting: forwardRef(() => NgForm)});
|
||||
|
||||
/**
|
||||
* 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 {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {
|
||||
|
@ -25,8 +24,8 @@ import {
|
|||
} from './shared';
|
||||
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
||||
|
||||
export const formControlBinding =
|
||||
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgFormControl)}));
|
||||
const formControlBinding =
|
||||
/*@ts2dart_const*/ new Provider(NgControl, {useExisting: forwardRef(() => NgFormControl)});
|
||||
|
||||
/**
|
||||
* 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 {BaseException} from 'angular2/src/facade/exceptions';
|
||||
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';
|
||||
|
||||
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.
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {
|
||||
OnChanges,
|
||||
|
@ -24,7 +23,7 @@ import {
|
|||
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
||||
|
||||
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.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
|
||||
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(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => NumberValueAccessor), multi: true}));
|
||||
export const NUMBER_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => NumberValueAccessor), multi: true}));
|
||||
|
||||
/**
|
||||
* The accessor for writing a number value and listening to changes that is used by the
|
||||
|
|
|
@ -17,11 +17,11 @@ import {
|
|||
ControlValueAccessor
|
||||
} from 'angular2/src/common/forms/directives/control_value_accessor';
|
||||
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';
|
||||
|
||||
export const RADIO_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => RadioControlValueAccessor), multi: true}));
|
||||
export const RADIO_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => RadioControlValueAccessor), multi: true}));
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
} from 'angular2/core';
|
||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||
import {
|
||||
CONST_EXPR,
|
||||
StringWrapper,
|
||||
isPrimitive,
|
||||
isPresent,
|
||||
|
@ -21,8 +20,8 @@ import {
|
|||
|
||||
import {MapWrapper} from 'angular2/src/facade/collection';
|
||||
|
||||
export const SELECT_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => SelectControlValueAccessor), multi: true}));
|
||||
export const SELECT_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
|
||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => SelectControlValueAccessor), multi: true}));
|
||||
|
||||
function _buildValueString(id: string, value: any): string {
|
||||
if (isBlank(id)) return `${value}`;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 {AbstractControl} 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}; }
|
||||
|
||||
const REQUIRED = /*@ts2dart_const*/(Validators.required);
|
||||
const REQUIRED = /*@ts2dart_const*/ Validators.required;
|
||||
|
||||
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
|
||||
|
@ -59,8 +59,8 @@ export interface AsyncValidatorFn {
|
|||
*
|
||||
* {@example common/forms/ts/validators/validators.ts region='min'}
|
||||
*/
|
||||
export const MIN_LENGTH_VALIDATOR = CONST_EXPR(
|
||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => MinLengthValidator), multi: true}));
|
||||
export const MIN_LENGTH_VALIDATOR = /*@ts2dart_const*/
|
||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => MinLengthValidator), multi: true}));
|
||||
|
||||
/**
|
||||
* 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'}
|
||||
*/
|
||||
export const MAX_LENGTH_VALIDATOR = CONST_EXPR(
|
||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => MaxLengthValidator), multi: true}));
|
||||
export const MAX_LENGTH_VALIDATOR = /*@ts2dart_const*/
|
||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => MaxLengthValidator), multi: true}));
|
||||
|
||||
/**
|
||||
* 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 ]*">
|
||||
* ```
|
||||
*/
|
||||
export const PATTERN_VALIDATOR = CONST_EXPR(
|
||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => PatternValidator), multi: true}));
|
||||
export const PATTERN_VALIDATOR = /*@ts2dart_const*/
|
||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => PatternValidator), multi: true}));
|
||||
@Directive({
|
||||
selector: '[pattern][ngControl],[pattern][ngFormControl],[pattern][ngModel]',
|
||||
providers: [PATTERN_VALIDATOR]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {Injectable} from 'angular2/core';
|
||||
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 {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 {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
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'}
|
||||
*/
|
||||
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
|
||||
|
@ -26,7 +26,8 @@ export const NG_VALIDATORS: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValidato
|
|||
*
|
||||
* 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.
|
||||
|
|
|
@ -13,7 +13,6 @@ import {DecimalPipe, PercentPipe, CurrencyPipe} from './number_pipe';
|
|||
import {ReplacePipe} from './replace_pipe';
|
||||
import {I18nPluralPipe} from './i18n_plural_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
|
||||
|
@ -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`
|
||||
* property of the `@Component` decorator.
|
||||
*/
|
||||
export const COMMON_PIPES = CONST_EXPR([
|
||||
export const COMMON_PIPES = /*@ts2dart_const*/[
|
||||
AsyncPipe,
|
||||
UpperCasePipe,
|
||||
LowerCasePipe,
|
||||
|
@ -35,4 +34,4 @@ export const COMMON_PIPES = CONST_EXPR([
|
|||
ReplacePipe,
|
||||
I18nPluralPipe,
|
||||
I18nSelectPipe
|
||||
]);
|
||||
];
|
||||
|
|
|
@ -1,63 +1,63 @@
|
|||
export const $EOF = /*@ts2dart_const*/(0);
|
||||
export const $TAB = /*@ts2dart_const*/(9);
|
||||
export const $LF = /*@ts2dart_const*/(10);
|
||||
export const $VTAB = /*@ts2dart_const*/(11);
|
||||
export const $FF = /*@ts2dart_const*/(12);
|
||||
export const $CR = /*@ts2dart_const*/(13);
|
||||
export const $SPACE = /*@ts2dart_const*/(32);
|
||||
export const $BANG = /*@ts2dart_const*/(33);
|
||||
export const $DQ = /*@ts2dart_const*/(34);
|
||||
export const $HASH = /*@ts2dart_const*/(35);
|
||||
export const $$ = /*@ts2dart_const*/(36);
|
||||
export const $PERCENT = /*@ts2dart_const*/(37);
|
||||
export const $AMPERSAND = /*@ts2dart_const*/(38);
|
||||
export const $SQ = /*@ts2dart_const*/(39);
|
||||
export const $LPAREN = /*@ts2dart_const*/(40);
|
||||
export const $RPAREN = /*@ts2dart_const*/(41);
|
||||
export const $STAR = /*@ts2dart_const*/(42);
|
||||
export const $PLUS = /*@ts2dart_const*/(43);
|
||||
export const $COMMA = /*@ts2dart_const*/(44);
|
||||
export const $MINUS = /*@ts2dart_const*/(45);
|
||||
export const $PERIOD = /*@ts2dart_const*/(46);
|
||||
export const $SLASH = /*@ts2dart_const*/(47);
|
||||
export const $COLON = /*@ts2dart_const*/(58);
|
||||
export const $SEMICOLON = /*@ts2dart_const*/(59);
|
||||
export const $LT = /*@ts2dart_const*/(60);
|
||||
export const $EQ = /*@ts2dart_const*/(61);
|
||||
export const $GT = /*@ts2dart_const*/(62);
|
||||
export const $QUESTION = /*@ts2dart_const*/(63);
|
||||
export const $EOF = /*@ts2dart_const*/ 0;
|
||||
export const $TAB = /*@ts2dart_const*/ 9;
|
||||
export const $LF = /*@ts2dart_const*/ 10;
|
||||
export const $VTAB = /*@ts2dart_const*/ 11;
|
||||
export const $FF = /*@ts2dart_const*/ 12;
|
||||
export const $CR = /*@ts2dart_const*/ 13;
|
||||
export const $SPACE = /*@ts2dart_const*/ 32;
|
||||
export const $BANG = /*@ts2dart_const*/ 33;
|
||||
export const $DQ = /*@ts2dart_const*/ 34;
|
||||
export const $HASH = /*@ts2dart_const*/ 35;
|
||||
export const $$ = /*@ts2dart_const*/ 36;
|
||||
export const $PERCENT = /*@ts2dart_const*/ 37;
|
||||
export const $AMPERSAND = /*@ts2dart_const*/ 38;
|
||||
export const $SQ = /*@ts2dart_const*/ 39;
|
||||
export const $LPAREN = /*@ts2dart_const*/ 40;
|
||||
export const $RPAREN = /*@ts2dart_const*/ 41;
|
||||
export const $STAR = /*@ts2dart_const*/ 42;
|
||||
export const $PLUS = /*@ts2dart_const*/ 43;
|
||||
export const $COMMA = /*@ts2dart_const*/ 44;
|
||||
export const $MINUS = /*@ts2dart_const*/ 45;
|
||||
export const $PERIOD = /*@ts2dart_const*/ 46;
|
||||
export const $SLASH = /*@ts2dart_const*/ 47;
|
||||
export const $COLON = /*@ts2dart_const*/ 58;
|
||||
export const $SEMICOLON = /*@ts2dart_const*/ 59;
|
||||
export const $LT = /*@ts2dart_const*/ 60;
|
||||
export const $EQ = /*@ts2dart_const*/ 61;
|
||||
export const $GT = /*@ts2dart_const*/ 62;
|
||||
export const $QUESTION = /*@ts2dart_const*/ 63;
|
||||
|
||||
export const $0 = /*@ts2dart_const*/(48);
|
||||
export const $9 = /*@ts2dart_const*/(57);
|
||||
export const $0 = /*@ts2dart_const*/ 48;
|
||||
export const $9 = /*@ts2dart_const*/ 57;
|
||||
|
||||
export const $A = /*@ts2dart_const*/(65);
|
||||
export const $E = /*@ts2dart_const*/(69);
|
||||
export const $Z = /*@ts2dart_const*/(90);
|
||||
export const $A = /*@ts2dart_const*/ 65;
|
||||
export const $E = /*@ts2dart_const*/ 69;
|
||||
export const $Z = /*@ts2dart_const*/ 90;
|
||||
|
||||
export const $LBRACKET = /*@ts2dart_const*/(91);
|
||||
export const $BACKSLASH = /*@ts2dart_const*/(92);
|
||||
export const $RBRACKET = /*@ts2dart_const*/(93);
|
||||
export const $CARET = /*@ts2dart_const*/(94);
|
||||
export const $_ = /*@ts2dart_const*/(95);
|
||||
export const $LBRACKET = /*@ts2dart_const*/ 91;
|
||||
export const $BACKSLASH = /*@ts2dart_const*/ 92;
|
||||
export const $RBRACKET = /*@ts2dart_const*/ 93;
|
||||
export const $CARET = /*@ts2dart_const*/ 94;
|
||||
export const $_ = /*@ts2dart_const*/ 95;
|
||||
|
||||
export const $a = /*@ts2dart_const*/(97);
|
||||
export const $e = /*@ts2dart_const*/(101);
|
||||
export const $f = /*@ts2dart_const*/(102);
|
||||
export const $n = /*@ts2dart_const*/(110);
|
||||
export const $r = /*@ts2dart_const*/(114);
|
||||
export const $t = /*@ts2dart_const*/(116);
|
||||
export const $u = /*@ts2dart_const*/(117);
|
||||
export const $v = /*@ts2dart_const*/(118);
|
||||
export const $z = /*@ts2dart_const*/(122);
|
||||
export const $a = /*@ts2dart_const*/ 97;
|
||||
export const $e = /*@ts2dart_const*/ 101;
|
||||
export const $f = /*@ts2dart_const*/ 102;
|
||||
export const $n = /*@ts2dart_const*/ 110;
|
||||
export const $r = /*@ts2dart_const*/ 114;
|
||||
export const $t = /*@ts2dart_const*/ 116;
|
||||
export const $u = /*@ts2dart_const*/ 117;
|
||||
export const $v = /*@ts2dart_const*/ 118;
|
||||
export const $z = /*@ts2dart_const*/ 122;
|
||||
|
||||
export const $LBRACE = /*@ts2dart_const*/(123);
|
||||
export const $BAR = /*@ts2dart_const*/(124);
|
||||
export const $RBRACE = /*@ts2dart_const*/(125);
|
||||
export const $NBSP = /*@ts2dart_const*/(160);
|
||||
export const $LBRACE = /*@ts2dart_const*/ 123;
|
||||
export const $BAR = /*@ts2dart_const*/ 124;
|
||||
export const $RBRACE = /*@ts2dart_const*/ 125;
|
||||
export const $NBSP = /*@ts2dart_const*/ 160;
|
||||
|
||||
export const $PIPE = /*@ts2dart_const*/(124);
|
||||
export const $TILDA = /*@ts2dart_const*/(126);
|
||||
export const $AT = /*@ts2dart_const*/(64);
|
||||
export const $PIPE = /*@ts2dart_const*/ 124;
|
||||
export const $TILDA = /*@ts2dart_const*/ 126;
|
||||
export const $AT = /*@ts2dart_const*/ 64;
|
||||
|
||||
export function isWhitespace(code: number): boolean {
|
||||
return (code >= $TAB && code <= $SPACE) || (code == $NBSP);
|
||||
|
|
|
@ -12,7 +12,7 @@ export {ViewResolver} from './view_resolver';
|
|||
export {DirectiveResolver} from './directive_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 {TemplateParser} from 'angular2/src/compiler/template_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
|
||||
* template compilation.
|
||||
*/
|
||||
export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = CONST_EXPR([
|
||||
export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = /*@ts2dart_const*/ [
|
||||
Lexer,
|
||||
Parser,
|
||||
HtmlParser,
|
||||
|
@ -50,7 +50,7 @@ export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = CONST_EXPR([
|
|||
DEFAULT_PACKAGE_URL_PROVIDER,
|
||||
StyleCompiler,
|
||||
ViewCompiler,
|
||||
new Provider(CompilerConfig, {useFactory: _createCompilerConfig, deps: []}),
|
||||
new Provider(CompilerConfig, {useFactory: _createCompilerConfig, deps: []},
|
||||
RuntimeCompiler,
|
||||
new Provider(ComponentResolver, {useExisting: RuntimeCompiler}),
|
||||
DomElementSchemaRegistry,
|
||||
|
|
|
@ -110,54 +110,54 @@ function newNumberToken(index: number, n: number): Token {
|
|||
|
||||
export var EOF: Token = new Token(-1, TokenType.Character, 0, "");
|
||||
|
||||
export const $EOF = /*@ts2dart_const*/(0);
|
||||
export const $TAB = /*@ts2dart_const*/(9);
|
||||
export const $LF = /*@ts2dart_const*/(10);
|
||||
export const $VTAB = /*@ts2dart_const*/(11);
|
||||
export const $FF = /*@ts2dart_const*/(12);
|
||||
export const $CR = /*@ts2dart_const*/(13);
|
||||
export const $SPACE = /*@ts2dart_const*/(32);
|
||||
export const $BANG = /*@ts2dart_const*/(33);
|
||||
export const $DQ = /*@ts2dart_const*/(34);
|
||||
export const $HASH = /*@ts2dart_const*/(35);
|
||||
export const $$ = /*@ts2dart_const*/(36);
|
||||
export const $PERCENT = /*@ts2dart_const*/(37);
|
||||
export const $AMPERSAND = /*@ts2dart_const*/(38);
|
||||
export const $SQ = /*@ts2dart_const*/(39);
|
||||
export const $LPAREN = /*@ts2dart_const*/(40);
|
||||
export const $RPAREN = /*@ts2dart_const*/(41);
|
||||
export const $STAR = /*@ts2dart_const*/(42);
|
||||
export const $PLUS = /*@ts2dart_const*/(43);
|
||||
export const $COMMA = /*@ts2dart_const*/(44);
|
||||
export const $MINUS = /*@ts2dart_const*/(45);
|
||||
export const $PERIOD = /*@ts2dart_const*/(46);
|
||||
export const $SLASH = /*@ts2dart_const*/(47);
|
||||
export const $COLON = /*@ts2dart_const*/(58);
|
||||
export const $SEMICOLON = /*@ts2dart_const*/(59);
|
||||
export const $LT = /*@ts2dart_const*/(60);
|
||||
export const $EQ = /*@ts2dart_const*/(61);
|
||||
export const $GT = /*@ts2dart_const*/(62);
|
||||
export const $QUESTION = /*@ts2dart_const*/(63);
|
||||
export const $EOF = /*@ts2dart_const*/ 0;
|
||||
export const $TAB = /*@ts2dart_const*/ 9;
|
||||
export const $LF = /*@ts2dart_const*/ 10;
|
||||
export const $VTAB = /*@ts2dart_const*/ 11;
|
||||
export const $FF = /*@ts2dart_const*/ 12;
|
||||
export const $CR = /*@ts2dart_const*/ 13;
|
||||
export const $SPACE = /*@ts2dart_const*/ 32;
|
||||
export const $BANG = /*@ts2dart_const*/ 33;
|
||||
export const $DQ = /*@ts2dart_const*/ 34;
|
||||
export const $HASH = /*@ts2dart_const*/ 35;
|
||||
export const $$ = /*@ts2dart_const*/ 36;
|
||||
export const $PERCENT = /*@ts2dart_const*/ 37;
|
||||
export const $AMPERSAND = /*@ts2dart_const*/ 38;
|
||||
export const $SQ = /*@ts2dart_const*/ 39;
|
||||
export const $LPAREN = /*@ts2dart_const*/ 40;
|
||||
export const $RPAREN = /*@ts2dart_const*/ 41;
|
||||
export const $STAR = /*@ts2dart_const*/ 42;
|
||||
export const $PLUS = /*@ts2dart_const*/ 43;
|
||||
export const $COMMA = /*@ts2dart_const*/ 44;
|
||||
export const $MINUS = /*@ts2dart_const*/ 45;
|
||||
export const $PERIOD = /*@ts2dart_const*/ 46;
|
||||
export const $SLASH = /*@ts2dart_const*/ 47;
|
||||
export const $COLON = /*@ts2dart_const*/ 58;
|
||||
export const $SEMICOLON = /*@ts2dart_const*/ 59;
|
||||
export const $LT = /*@ts2dart_const*/ 60;
|
||||
export const $EQ = /*@ts2dart_const*/ 61;
|
||||
export const $GT = /*@ts2dart_const*/ 62;
|
||||
export const $QUESTION = /*@ts2dart_const*/ 63;
|
||||
|
||||
const $0 = /*@ts2dart_const*/(48);
|
||||
const $9 = /*@ts2dart_const*/(57);
|
||||
const $0 = /*@ts2dart_const*/ 48;
|
||||
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 $BACKSLASH = /*@ts2dart_const*/(92);
|
||||
export const $RBRACKET = /*@ts2dart_const*/(93);
|
||||
const $CARET = /*@ts2dart_const*/(94);
|
||||
const $_ = /*@ts2dart_const*/(95);
|
||||
export const $BT = /*@ts2dart_const*/(96);
|
||||
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 $u = /*@ts2dart_const*/(117), $v = /*@ts2dart_const*/(118), $z = /*@ts2dart_const*/(122);
|
||||
export const $LBRACKET = /*@ts2dart_const*/ 91;
|
||||
export const $BACKSLASH = /*@ts2dart_const*/ 92;
|
||||
export const $RBRACKET = /*@ts2dart_const*/ 93;
|
||||
const $CARET = /*@ts2dart_const*/ 94;
|
||||
const $_ = /*@ts2dart_const*/ 95;
|
||||
export const $BT = /*@ts2dart_const*/ 96;
|
||||
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,
|
||||
$u = /*@ts2dart_const*/ 117, $v = /*@ts2dart_const*/ 118, $z = /*@ts2dart_const*/ 122;
|
||||
|
||||
export const $LBRACE = /*@ts2dart_const*/(123);
|
||||
export const $BAR = /*@ts2dart_const*/(124);
|
||||
export const $RBRACE = /*@ts2dart_const*/(125);
|
||||
const $NBSP = /*@ts2dart_const*/(160);
|
||||
export const $LBRACE = /*@ts2dart_const*/ 123;
|
||||
export const $BAR = /*@ts2dart_const*/ 124;
|
||||
export const $RBRACE = /*@ts2dart_const*/ 125;
|
||||
const $NBSP = /*@ts2dart_const*/ 160;
|
||||
|
||||
export class ScannerError extends BaseException {
|
||||
constructor(public message) { super(); }
|
||||
|
|
|
@ -3,7 +3,6 @@ import {
|
|||
NumberWrapper,
|
||||
isPresent,
|
||||
isBlank,
|
||||
CONST_EXPR,
|
||||
serializeEnum
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
|
|
|
@ -6,7 +6,6 @@ import {
|
|||
assertionsEnabled,
|
||||
StringJoiner,
|
||||
serializeEnum,
|
||||
CONST_EXPR
|
||||
} from 'angular2/src/facade/lang';
|
||||
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
|
@ -367,4 +366,4 @@ function getElementFullName(prefix: string, localName: string,
|
|||
|
||||
function lastOnStack(stack: any[], element: any): boolean {
|
||||
return stack.length > 0 && stack[stack.length - 1] === element;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,13 @@ import {
|
|||
isBlank,
|
||||
normalizeBool,
|
||||
RegExpWrapper,
|
||||
CONST_EXPR
|
||||
} from 'angular2/src/facade/lang';
|
||||
|
||||
// see http://www.w3.org/TR/html51/syntax.html#named-character-references
|
||||
// see https://html.spec.whatwg.org/multipage/entities.json
|
||||
// This list is not exhaustive to keep the compiler footprint low.
|
||||
// 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': '\u00E1',
|
||||
'Acirc': '\u00C2',
|
||||
|
@ -263,7 +262,7 @@ export const NAMED_ENTITIES = CONST_EXPR({
|
|||
'zeta': '\u03B6',
|
||||
'zwj': '\u200D',
|
||||
'zwnj': '\u200C',
|
||||
});
|
||||
};
|
||||
|
||||
export enum HtmlTagContentType {
|
||||
RAW_TEXT,
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
import {Injectable, Provider, provide} from 'angular2/src/core/di';
|
||||
|
||||
import {
|
||||
StringWrapper,
|
||||
RegExpWrapper,
|
||||
CONST_EXPR,
|
||||
isBlank,
|
||||
isPresent
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {StringWrapper, RegExpWrapper, isBlank, isPresent} from 'angular2/src/facade/lang';
|
||||
|
||||
import {
|
||||
HtmlAstVisitor,
|
||||
|
@ -29,11 +23,11 @@ var TEMPLATE_SELECTOR_REGEXP = /^(\S+)/g;
|
|||
var SPECIAL_PREFIXES_REGEXP = /^(class|style|attr)\./ig;
|
||||
var INTERPOLATION_REGEXP = /\{\{.*?\}\}/g;
|
||||
|
||||
const SPECIAL_CASES = CONST_EXPR([
|
||||
const SPECIAL_CASES = /*@ts2dart_const*/[
|
||||
'ng-non-bindable',
|
||||
'ng-default-control',
|
||||
'ng-no-form',
|
||||
]);
|
||||
];
|
||||
|
||||
/**
|
||||
* 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';
|
||||
|
||||
//// Types
|
||||
|
@ -545,7 +545,7 @@ export class ClassStmt extends Statement {
|
|||
|
||||
export class IfStmt extends Statement {
|
||||
constructor(public condition: Expression, public trueCase: Statement[],
|
||||
public falseCase: Statement[] = CONST_EXPR([])) {
|
||||
public falseCase: Statement[] = /*@ts2dart_const*/[]) {
|
||||
super();
|
||||
}
|
||||
visitStatement(visitor: StatementVisitor, context: any): any {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||
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';
|
||||
|
||||
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()
|
||||
export class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
||||
|
|
|
@ -12,8 +12,8 @@ import {Injectable} from 'angular2/src/core/di';
|
|||
import {isPresent} from 'angular2/src/facade/lang';
|
||||
|
||||
const COMPONENT_VARIABLE = '%COMP%';
|
||||
const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
||||
const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
||||
const HOST_ATTR = /*@ts2dart_const*/ `_nghost-${COMPONENT_VARIABLE}`;
|
||||
const CONTENT_ATTR = /*@ts2dart_const*/ `_ngcontent-${COMPONENT_VARIABLE}`;
|
||||
|
||||
export class StylesCompileDependency {
|
||||
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.
|
||||
*/
|
||||
export const TEMPLATE_TRANSFORMS = CONST_EXPR(new OpaqueToken('TemplateTransforms'));
|
||||
export const TEMPLATE_TRANSFORMS = /*@ts2dart_const*/ new OpaqueToken('TemplateTransforms');
|
||||
|
||||
export class TemplateParseError extends ParseError {
|
||||
constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel) {
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as o from '../output/output_ast';
|
|||
import {Identifiers} from '../identifiers';
|
||||
|
||||
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');
|
||||
|
||||
|
@ -249,4 +249,4 @@ function flattenStatements(arg: any, output: o.Statement[]) {
|
|||
} else {
|
||||
output.push(arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
TemplateAst
|
||||
} 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 {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 {APP_ID_RANDOM_PROVIDER} from './application_tokens';
|
||||
import {APPLICATION_CORE_PROVIDERS} from './application_ref';
|
||||
|
@ -18,12 +18,12 @@ var __unused: Type; // avoid unused import when Type union types are erased
|
|||
* A default set of providers which should be included in any Angular
|
||||
* 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,
|
||||
new Provider(ComponentResolver, {useClass: ReflectorComponentResolver}),
|
||||
new Provider(ComponentResolver, {useClass: ReflectorComponentResolver},
|
||||
APP_ID_RANDOM_PROVIDER,
|
||||
ViewUtils,
|
||||
new Provider(IterableDiffers, {useValue: defaultIterableDiffers}),
|
||||
new Provider(KeyValueDiffers, {useValue: defaultKeyValueDiffers}),
|
||||
new Provider(DynamicComponentLoader, {useClass: DynamicComponentLoader_})
|
||||
]);
|
||||
]);
|
||||
|
|
|
@ -6,7 +6,6 @@ import {
|
|||
assertionsEnabled,
|
||||
print,
|
||||
IS_DART,
|
||||
CONST_EXPR,
|
||||
lockMode,
|
||||
isPromise
|
||||
} from 'angular2/src/facade/lang';
|
||||
|
@ -436,13 +435,13 @@ export class ApplicationRef_ extends ApplicationRef {
|
|||
* @internal
|
||||
*/
|
||||
export const PLATFORM_CORE_PROVIDERS =
|
||||
CONST_EXPR([PlatformRef_, CONST_EXPR(new Provider(PlatformRef, {useExisting: PlatformRef_}))]);
|
||||
/*@ts2dart_const*/[PlatformRef_, new Provider(PlatformRef, {useExisting: PlatformRef_})];
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const APPLICATION_CORE_PROVIDERS = CONST_EXPR([
|
||||
CONST_EXPR(new Provider(NgZone, {useFactory: createNgZone, deps: CONST_EXPR([])})),
|
||||
export const APPLICATION_CORE_PROVIDERS = /*@ts2dart_const*/[
|
||||
new Provider(NgZone, {useFactory: createNgZone, deps: []}),
|
||||
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 {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
|
||||
|
@ -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}
|
||||
* 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() {
|
||||
return `${_randomChar()}${_randomChar()}${_randomChar()}`;
|
||||
|
@ -20,7 +20,7 @@ function _appIdRandomProviderFactory() {
|
|||
* Providers that will generate a random APP_ID_TOKEN.
|
||||
*/
|
||||
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 {
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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,
|
||||
KeyValueChangeRecord
|
||||
} from './differs/default_keyvalue_differ';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
export {
|
||||
DefaultKeyValueDifferFactory,
|
||||
|
@ -46,14 +45,14 @@ export {
|
|||
* Structural diffing for `Object`s and `Map`s.
|
||||
*/
|
||||
export const keyValDiff: KeyValueDifferFactory[] =
|
||||
CONST_EXPR([CONST_EXPR(new DefaultKeyValueDifferFactory())]);
|
||||
/*@ts2dart_const*/[new DefaultKeyValueDifferFactory()];
|
||||
|
||||
/**
|
||||
* Structural diffing for `Iterable` types such as `Array`s.
|
||||
*/
|
||||
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 {
|
||||
StringMapWrapper,
|
||||
isListLikeIterable,
|
||||
|
@ -6,7 +6,7 @@ import {
|
|||
} from 'angular2/src/facade/collection';
|
||||
|
||||
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 {
|
||||
if (isListLikeIterable(a) && isListLikeIterable(b)) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
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 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.
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
InvalidProviderError,
|
||||
OutOfBoundsError
|
||||
} 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 {ReflectiveKey} from './reflective_key';
|
||||
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
|
||||
const _MAX_CONSTRUCTION_COUNTER = 10;
|
||||
const UNDEFINED = CONST_EXPR(new Object());
|
||||
const UNDEFINED = /*@ts2dart_const*/ new Object();
|
||||
|
||||
export interface ReflectiveProtoInjectorStrategy {
|
||||
getProviderAtIndex(index: number): ResolvedReflectiveProvider;
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
import {
|
||||
Type,
|
||||
isBlank,
|
||||
isPresent,
|
||||
CONST,
|
||||
CONST_EXPR,
|
||||
isArray,
|
||||
isType
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {Type, isBlank, isPresent, CONST, isArray, isType} from 'angular2/src/facade/lang';
|
||||
import {MapWrapper, ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
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}.
|
||||
|
|
|
@ -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 {AppView} from './view';
|
||||
|
||||
const _UNDEFINED = CONST_EXPR(new Object());
|
||||
const _UNDEFINED = /*@ts2dart_const*/ new Object();
|
||||
|
||||
export class ElementInjector extends Injector {
|
||||
constructor(private _view: AppView<any>, private _nodeIndex: number) { super(); }
|
||||
|
|
|
@ -17,7 +17,6 @@ import {
|
|||
isArray,
|
||||
isNumber,
|
||||
CONST,
|
||||
CONST_EXPR,
|
||||
stringify,
|
||||
isPrimitive,
|
||||
isString
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
import {
|
||||
isBlank,
|
||||
isPresent,
|
||||
Type,
|
||||
stringify,
|
||||
CONST_EXPR,
|
||||
looseIdentical
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {isBlank, isPresent, Type, stringify, looseIdentical} from 'angular2/src/facade/lang';
|
||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||
import {AppElement} from './element';
|
||||
|
@ -60,7 +53,7 @@ function _flattenNestedViewRenderNodes(nodes: any[], renderNodes: any[]): any[]
|
|||
return renderNodes;
|
||||
}
|
||||
|
||||
const EMPTY_ARR = CONST_EXPR([]);
|
||||
const EMPTY_ARR = /*@ts2dart_const*/[];
|
||||
|
||||
export function ensureSlotCount(projectableNodes: any[][], expectedSlotCount: number): any[][] {
|
||||
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 {ChangeDetectionStrategy} from 'angular2/src/core/change_detection';
|
||||
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 {Console} from 'angular2/src/core/console';
|
||||
import {Reflector, reflector} from './reflection/reflection';
|
||||
|
@ -13,10 +13,10 @@ function _reflector(): Reflector {
|
|||
/**
|
||||
* 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,
|
||||
new Provider(Reflector, {useFactory: _reflector, deps: []}),
|
||||
new Provider(Reflector, {useFactory: _reflector, deps: []},
|
||||
new Provider(ReflectorReader, {useExisting: Reflector}),
|
||||
TestabilityRegistry,
|
||||
Console
|
||||
]);
|
||||
]);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
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
|
||||
|
@ -25,7 +24,8 @@ import {CONST_EXPR} from "angular2/src/facade/lang";
|
|||
* 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
|
||||
|
@ -50,4 +50,4 @@ export const PLATFORM_DIRECTIVES: OpaqueToken = CONST_EXPR(new OpaqueToken("Plat
|
|||
* 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 {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 {NgZone} from '../zone/ng_zone';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
|
@ -150,4 +150,4 @@ export function setTestabilityGetter(getter: GetTestability): void {
|
|||
_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
|
||||
};
|
||||
|
||||
// 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 {
|
||||
return (target) => target;
|
||||
}
|
||||
|
|
|
@ -2,13 +2,7 @@ import {RequestMethod} from './enums';
|
|||
import {RequestArgs} from './interfaces';
|
||||
import {Headers} from './headers';
|
||||
import {normalizeMethodName} from './http_utils';
|
||||
import {
|
||||
RegExpWrapper,
|
||||
CONST_EXPR,
|
||||
isPresent,
|
||||
isJsObject,
|
||||
StringWrapper
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {RegExpWrapper, isPresent, isJsObject, StringWrapper} from 'angular2/src/facade/lang';
|
||||
|
||||
// TODO(jeffbcross): properly implement body accessors
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 {Headers} from './headers';
|
||||
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';
|
||||
|
||||
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 {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 {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 {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 {XHR} from 'angular2/src/compiler/xhr';
|
||||
import {
|
||||
|
@ -46,15 +46,16 @@ export {BrowserDomAdapter} from './browser/browser_adapter';
|
|||
export {enableDebugTools, disableDebugTools} from 'angular2/src/platform/browser/tools/tools';
|
||||
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.
|
||||
*
|
||||
* Used automatically by `bootstrap`, or can be passed to {@link platform}.
|
||||
*/
|
||||
export const BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
||||
new Provider(BROWSER_PLATFORM_MARKER, {useValue: true}),
|
||||
export const BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/ [
|
||||
new Provider(BROWSER_PLATFORM_MARKER, {useValue: true},
|
||||
PLATFORM_COMMON_PROVIDERS,
|
||||
new Provider(PLATFORM_INITIALIZER, {useValue: initDomAdapter, multi: true}),
|
||||
]);
|
||||
|
@ -74,30 +75,31 @@ function _document(): any {
|
|||
*
|
||||
* 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([
|
||||
APPLICATION_COMMON_PROVIDERS,
|
||||
FORM_PROVIDERS,
|
||||
new Provider(PLATFORM_PIPES, {useValue: COMMON_PIPES, multi: true}),
|
||||
new Provider(PLATFORM_DIRECTIVES, {useValue: COMMON_DIRECTIVES, multi: true}),
|
||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||
new Provider(DOCUMENT, {useFactory: _document, deps: []}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: DomEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: KeyEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: HammerGesturesPlugin, multi: true}),
|
||||
new Provider(HAMMER_GESTURE_CONFIG, {useClass: HammerGestureConfig}),
|
||||
new Provider(DomRootRenderer, {useClass: DomRootRenderer_}),
|
||||
new Provider(RootRenderer, {useExisting: DomRootRenderer}),
|
||||
new Provider(SharedStylesHost, {useExisting: DomSharedStylesHost}),
|
||||
DomSharedStylesHost,
|
||||
Testability,
|
||||
BrowserDetails,
|
||||
AnimationBuilder,
|
||||
EventManager,
|
||||
ELEMENT_PROBE_PROVIDERS
|
||||
]);
|
||||
export const BROWSER_APP_COMMON_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
/*@ts2dart_const*/ [
|
||||
APPLICATION_COMMON_PROVIDERS,
|
||||
FORM_PROVIDERS,
|
||||
new Provider(PLATFORM_PIPES, {useValue: COMMON_PIPES, multi: true},
|
||||
new Provider(PLATFORM_DIRECTIVES, {useValue: COMMON_DIRECTIVES, multi: true}),
|
||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||
new Provider(DOCUMENT, {useFactory: _document, deps: []}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: DomEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: KeyEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: HammerGesturesPlugin, multi: true}),
|
||||
new Provider(HAMMER_GESTURE_CONFIG, {useClass: HammerGestureConfig}),
|
||||
new Provider(DomRootRenderer, {useClass: DomRootRenderer_}),
|
||||
new Provider(RootRenderer, {useExisting: DomRootRenderer}),
|
||||
new Provider(SharedStylesHost, {useExisting: DomSharedStylesHost}),
|
||||
DomSharedStylesHost,
|
||||
Testability,
|
||||
BrowserDetails,
|
||||
AnimationBuilder,
|
||||
EventManager,
|
||||
ELEMENT_PROBE_PROVIDERS
|
||||
]);
|
||||
|
||||
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() {
|
||||
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 {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||
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 {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 CORE_TOKENS_GLOBAL_NAME = 'ng.coreTokens';
|
||||
|
@ -36,10 +36,10 @@ function _createRootRenderer(rootRenderer) {
|
|||
/**
|
||||
* 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,
|
||||
{useFactory: _createConditionalRootRenderer, deps: [DomRootRenderer]})
|
||||
{useFactory: _createConditionalRootRenderer, deps: [DomRootRenderer]}
|
||||
]);
|
||||
|
||||
export const ELEMENT_PROBE_PROVIDERS_PROD_MODE: any[] = CONST_EXPR(
|
||||
[new Provider(RootRenderer, {useFactory: _createRootRenderer, deps: [DomRootRenderer]})]);
|
||||
export const ELEMENT_PROBE_PROVIDERS_PROD_MODE: any[] = /*@ts2dart_const*/
|
||||
[new Provider(RootRenderer, {useFactory: _createRootRenderer, deps: [DomRootRenderer]}]);
|
||||
|
|
|
@ -5,7 +5,6 @@ import {
|
|||
isBlank,
|
||||
Json,
|
||||
RegExpWrapper,
|
||||
CONST_EXPR,
|
||||
stringify,
|
||||
StringWrapper,
|
||||
isArray,
|
||||
|
@ -30,7 +29,8 @@ import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
|||
import {camelCaseToDashCase} from './util';
|
||||
|
||||
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={}';
|
||||
var TEMPLATE_BINDINGS_EXP = /^template bindings=(.*)$/g;
|
||||
|
||||
|
@ -304,8 +304,8 @@ function decoratePreventDefault(eventHandler: Function): Function {
|
|||
|
||||
var COMPONENT_REGEX = /%COMP%/g;
|
||||
export const COMPONENT_VARIABLE = '%COMP%';
|
||||
export const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
||||
export const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
||||
export const HOST_ATTR = /*@ts2dart_const*/ `_nghost-${COMPONENT_VARIABLE}`;
|
||||
export const CONTENT_ATTR = /*@ts2dart_const*/ `_ngcontent-${COMPONENT_VARIABLE}`;
|
||||
|
||||
function _shimContentAttribute(componentShortId: string): string {
|
||||
return StringWrapper.replaceAll(CONTENT_ATTR, COMPONENT_REGEX, componentShortId);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
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.
|
||||
|
@ -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
|
||||
* 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 {Injectable, Inject, OpaqueToken} from 'angular2/src/core/di';
|
||||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
|
||||
export const EVENT_MANAGER_PLUGINS: OpaqueToken =
|
||||
CONST_EXPR(new OpaqueToken("EventManagerPlugins"));
|
||||
/*@ts2dart_const*/ new OpaqueToken("EventManagerPlugins");
|
||||
|
||||
@Injectable()
|
||||
export class EventManager {
|
||||
|
@ -54,4 +53,4 @@ export class EventManagerPlugin {
|
|||
addGlobalEventListener(element: string, eventName: string, handler: Function): Function {
|
||||
throw "not implemented";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
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 {Injectable, Inject, OpaqueToken} from 'angular2/core';
|
||||
|
||||
export const HAMMER_GESTURE_CONFIG: OpaqueToken =
|
||||
CONST_EXPR(new OpaqueToken("HammerGestureConfig"));
|
||||
/*@ts2dart_const*/ new OpaqueToken("HammerGestureConfig");
|
||||
|
||||
export interface HammerInstance {
|
||||
on(eventName: string, callback: Function): void;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 {Parse5DomAdapter} from 'angular2/src/platform/server/parse5_adapter';
|
||||
import {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {XHR} from 'angular2/src/compiler/xhr';
|
||||
import {WebWorkerXHRImpl} from 'angular2/src/web_workers/worker/xhr_impl';
|
||||
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 {
|
||||
PLATFORM_DIRECTIVES,
|
||||
|
@ -32,29 +32,29 @@ class PrintLogger {
|
|||
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([
|
||||
PLATFORM_COMMON_PROVIDERS,
|
||||
CONST_EXPR(new Provider(WORKER_APP_PLATFORM_MARKER, {useValue: true}))
|
||||
]);
|
||||
export const WORKER_APP_PLATFORM: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/
|
||||
[PLATFORM_COMMON_PROVIDERS, new Provider(WORKER_APP_PLATFORM_MARKER, {useValue: true})];
|
||||
|
||||
export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
||||
APPLICATION_COMMON_PROVIDERS,
|
||||
FORM_PROVIDERS,
|
||||
Serializer,
|
||||
new Provider(PLATFORM_PIPES, {useValue: COMMON_PIPES, multi: true}),
|
||||
new Provider(PLATFORM_DIRECTIVES, {useValue: COMMON_DIRECTIVES, multi: true}),
|
||||
new Provider(ClientMessageBrokerFactory, {useClass: ClientMessageBrokerFactory_}),
|
||||
new Provider(ServiceMessageBrokerFactory, {useClass: ServiceMessageBrokerFactory_}),
|
||||
WebWorkerRootRenderer,
|
||||
new Provider(RootRenderer, {useExisting: WebWorkerRootRenderer}),
|
||||
new Provider(ON_WEB_WORKER, {useValue: true}),
|
||||
RenderStore,
|
||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||
WebWorkerXHRImpl,
|
||||
new Provider(XHR, {useExisting: WebWorkerXHRImpl})
|
||||
]);
|
||||
export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> =
|
||||
/*@ts2dart_const*/[
|
||||
APPLICATION_COMMON_PROVIDERS,
|
||||
FORM_PROVIDERS,
|
||||
Serializer,
|
||||
new Provider(PLATFORM_PIPES, {useValue: COMMON_PIPES, multi: true}),
|
||||
new Provider(PLATFORM_DIRECTIVES, {useValue: COMMON_DIRECTIVES, multi: true}),
|
||||
new Provider(ClientMessageBrokerFactory, {useClass: ClientMessageBrokerFactory_}),
|
||||
new Provider(ServiceMessageBrokerFactory, {useClass: ServiceMessageBrokerFactory_}),
|
||||
WebWorkerRootRenderer,
|
||||
new Provider(RootRenderer, {useExisting: WebWorkerRootRenderer}),
|
||||
new Provider(ON_WEB_WORKER, {useValue: true}),
|
||||
RenderStore,
|
||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||
WebWorkerXHRImpl,
|
||||
new Provider(XHR, {useExisting: WebWorkerXHRImpl})
|
||||
];
|
||||
|
||||
function _exceptionHandler(): ExceptionHandler {
|
||||
return new ExceptionHandler(new PrintLogger());
|
||||
|
|
|
@ -15,7 +15,6 @@ import {
|
|||
initializeGenericWorkerRenderer
|
||||
} from 'angular2/src/platform/worker_render_common';
|
||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export const WORKER_RENDER_APPLICATION: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
|
||||
WORKER_RENDER_APPLICATION_COMMON,
|
||||
WebWorkerInstance,
|
||||
new Provider(APP_INITIALIZER,
|
||||
{
|
||||
useFactory: (injector) => () => initWebWorkerApplication(injector),
|
||||
multi: true,
|
||||
deps: [Injector]
|
||||
}),
|
||||
new Provider(MessageBus, {useFactory: (instance) => instance.bus, deps: [WebWorkerInstance]})
|
||||
]);
|
||||
export const WORKER_RENDER_APPLICATION: Array<any /*Type | Provider | any[]*/> =
|
||||
/*@ts2dart_const*/ [
|
||||
WORKER_RENDER_APPLICATION_COMMON,
|
||||
WebWorkerInstance,
|
||||
new Provider(APP_INITIALIZER,
|
||||
{
|
||||
useFactory: (injector => () => initWebWorkerApplication(injector),
|
||||
multi: true,
|
||||
deps: [Injector]
|
||||
}),
|
||||
new Provider(MessageBus,
|
||||
{useFactory: (instance) => instance.bus, deps: [WebWorkerInstance]})
|
||||
]);
|
||||
|
||||
function initWebWorkerApplication(injector: Injector): void {
|
||||
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 {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||
import {
|
||||
|
@ -53,55 +53,56 @@ import {
|
|||
HammerGesturesPlugin
|
||||
} 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
|
||||
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 =
|
||||
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,
|
||||
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})
|
||||
]);
|
||||
];
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
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([
|
||||
APPLICATION_COMMON_PROVIDERS,
|
||||
WORKER_RENDER_MESSAGING_PROVIDERS,
|
||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||
new Provider(DOCUMENT, {useFactory: _document, deps: []}),
|
||||
// TODO(jteplitz602): Investigate if we definitely need EVENT_MANAGER on the render thread
|
||||
// #5298
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: DomEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: KeyEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: HammerGesturesPlugin, multi: true}),
|
||||
new Provider(HAMMER_GESTURE_CONFIG, {useClass: HammerGestureConfig}),
|
||||
new Provider(DomRootRenderer, {useClass: DomRootRenderer_}),
|
||||
new Provider(RootRenderer, {useExisting: DomRootRenderer}),
|
||||
new Provider(SharedStylesHost, {useExisting: DomSharedStylesHost}),
|
||||
new Provider(XHR, {useClass: XHRImpl}),
|
||||
MessageBasedXHRImpl,
|
||||
new Provider(ServiceMessageBrokerFactory, {useClass: ServiceMessageBrokerFactory_}),
|
||||
new Provider(ClientMessageBrokerFactory, {useClass: ClientMessageBrokerFactory_}),
|
||||
Serializer,
|
||||
new Provider(ON_WEB_WORKER, {useValue: false}),
|
||||
RenderStore,
|
||||
DomSharedStylesHost,
|
||||
Testability,
|
||||
BrowserDetails,
|
||||
AnimationBuilder,
|
||||
EventManager
|
||||
]);
|
||||
export const WORKER_RENDER_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> =
|
||||
/*@ts2dart_const*/[
|
||||
APPLICATION_COMMON_PROVIDERS,
|
||||
WORKER_RENDER_MESSAGING_PROVIDERS,
|
||||
new Provider(ExceptionHandler, {useFactory: _exceptionHandler, deps: []}),
|
||||
new Provider(DOCUMENT, {useFactory: _document, deps: []}),
|
||||
// TODO(jteplitz602): Investigate if we definitely need EVENT_MANAGER on the render thread
|
||||
// #5298
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: DomEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: KeyEventsPlugin, multi: true}),
|
||||
new Provider(EVENT_MANAGER_PLUGINS, {useClass: HammerGesturesPlugin, multi: true}),
|
||||
new Provider(HAMMER_GESTURE_CONFIG, {useClass: HammerGestureConfig}),
|
||||
new Provider(DomRootRenderer, {useClass: DomRootRenderer_}),
|
||||
new Provider(RootRenderer, {useExisting: DomRootRenderer}),
|
||||
new Provider(SharedStylesHost, {useExisting: DomSharedStylesHost}),
|
||||
new Provider(XHR, {useClass: XHRImpl}),
|
||||
MessageBasedXHRImpl,
|
||||
new Provider(ServiceMessageBrokerFactory, {useClass: ServiceMessageBrokerFactory_}),
|
||||
new Provider(ClientMessageBrokerFactory, {useClass: ClientMessageBrokerFactory_}),
|
||||
Serializer,
|
||||
new Provider(ON_WEB_WORKER, {useValue: false}),
|
||||
RenderStore,
|
||||
DomSharedStylesHost,
|
||||
Testability,
|
||||
BrowserDetails,
|
||||
AnimationBuilder,
|
||||
EventManager
|
||||
];
|
||||
|
||||
export function initializeGenericWorkerRenderer(injector: Injector) {
|
||||
var bus = injector.get(MessageBus);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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';
|
||||
|
||||
|
||||
|
@ -74,7 +74,7 @@ export class RouteParams {
|
|||
* ```
|
||||
*/
|
||||
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)); }
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ export class DefaultInstruction extends ResolvedInstruction {
|
|||
*/
|
||||
export class UnresolvedInstruction extends Instruction {
|
||||
constructor(private _resolver: () => Promise<Instruction>, private _urlPath: string = '',
|
||||
private _urlParams: string[] = CONST_EXPR([])) {
|
||||
private _urlParams: string[] = /*@ts2dart_const*/[]) {
|
||||
super(null, null, {});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {CONST, CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {CONST} from 'angular2/src/facade/lang';
|
||||
|
||||
@CONST()
|
||||
export class RouteLifecycleHook {
|
||||
|
@ -11,12 +11,12 @@ export class CanActivate {
|
|||
}
|
||||
|
||||
export const routerCanReuse: RouteLifecycleHook =
|
||||
CONST_EXPR(new RouteLifecycleHook("routerCanReuse"));
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook("routerCanReuse");
|
||||
export const routerCanDeactivate: RouteLifecycleHook =
|
||||
CONST_EXPR(new RouteLifecycleHook("routerCanDeactivate"));
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook("routerCanDeactivate");
|
||||
export const routerOnActivate: RouteLifecycleHook =
|
||||
CONST_EXPR(new RouteLifecycleHook("routerOnActivate"));
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook("routerOnActivate");
|
||||
export const routerOnReuse: RouteLifecycleHook =
|
||||
CONST_EXPR(new RouteLifecycleHook("routerOnReuse"));
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook("routerOnReuse");
|
||||
export const routerOnDeactivate: RouteLifecycleHook =
|
||||
CONST_EXPR(new RouteLifecycleHook("routerOnDeactivate"));
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook("routerOnDeactivate");
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
StringWrapper,
|
||||
Math,
|
||||
getTypeNameForDebugging,
|
||||
CONST_EXPR
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
|
@ -77,7 +76,7 @@ var _resolveToNull = PromiseWrapper.resolve<Instruction>(null);
|
|||
* ```
|
||||
*/
|
||||
export const ROUTER_PRIMARY_COMPONENT: OpaqueToken =
|
||||
CONST_EXPR(new OpaqueToken('RouterPrimaryComponent'));
|
||||
/*@ts2dart_const*/ new OpaqueToken('RouterPrimaryComponent');
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,6 @@ import {
|
|||
BrowserPlatformLocation
|
||||
} from 'angular2/src/platform/browser/location/browser_platform_location';
|
||||
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.
|
||||
|
@ -30,14 +29,14 @@ import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|||
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
||||
* ```
|
||||
*/
|
||||
export const ROUTER_PROVIDERS: any[] = CONST_EXPR([
|
||||
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
|
||||
ROUTER_PROVIDERS_COMMON,
|
||||
CONST_EXPR(new Provider(PlatformLocation, {useClass: BrowserPlatformLocation})),
|
||||
]);
|
||||
new Provider(PlatformLocation, {useClass: BrowserPlatformLocation}),
|
||||
];
|
||||
|
||||
/**
|
||||
* Use {@link ROUTER_PROVIDERS} instead.
|
||||
*
|
||||
* @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 {Router, RootRouter} from 'angular2/src/router/router';
|
||||
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 {BaseException} from 'angular2/src/facade/exceptions';
|
||||
|
||||
/**
|
||||
* The Platform agnostic ROUTER PROVIDERS
|
||||
*/
|
||||
export const ROUTER_PROVIDERS_COMMON: any[] = CONST_EXPR([
|
||||
export const ROUTER_PROVIDERS_COMMON: any[] = /*@ts2dart_const*/[
|
||||
RouteRegistry,
|
||||
CONST_EXPR(new Provider(LocationStrategy, {useClass: PathLocationStrategy})),
|
||||
new Provider(LocationStrategy, {useClass: PathLocationStrategy}),
|
||||
Location,
|
||||
CONST_EXPR(new Provider(
|
||||
Router,
|
||||
{
|
||||
useFactory: routerFactory,
|
||||
deps: CONST_EXPR([RouteRegistry, Location, ROUTER_PRIMARY_COMPONENT, ApplicationRef])
|
||||
})),
|
||||
CONST_EXPR(new Provider(
|
||||
ROUTER_PRIMARY_COMPONENT,
|
||||
{useFactory: routerPrimaryComponentFactory, deps: CONST_EXPR([ApplicationRef])}))
|
||||
]);
|
||||
new Provider(Router,
|
||||
{
|
||||
useFactory: routerFactory,
|
||||
deps: [RouteRegistry, Location, ROUTER_PRIMARY_COMPONENT, ApplicationRef]
|
||||
}),
|
||||
new Provider(ROUTER_PRIMARY_COMPONENT,
|
||||
{useFactory: routerPrimaryComponentFactory, deps: [ApplicationRef]})
|
||||
];
|
||||
|
||||
function routerFactory(registry: RouteRegistry, location: Location, primaryComponent: Type,
|
||||
appRef: ApplicationRef): RootRouter {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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';
|
||||
|
||||
export function convertUrlParamsToArray(urlParams: {[key: string]: any}): string[] {
|
||||
|
@ -22,8 +22,8 @@ export function serializeParams(urlParams: {[key: string]: any}, joiner = '&'):
|
|||
*/
|
||||
export class Url {
|
||||
constructor(public path: string, public child: Url = null,
|
||||
public auxiliary: Url[] = CONST_EXPR([]),
|
||||
public params: {[key: string]: any} = CONST_EXPR({})) {}
|
||||
public auxiliary: Url[] = /*@ts2dart_const*/[],
|
||||
public params: {[key: string]: any} = /*@ts2dart_const*/ {}) {}
|
||||
|
||||
toString(): string {
|
||||
return this.path + this._matrixParamsToString() + this._auxToString() + this._childString();
|
||||
|
@ -51,7 +51,7 @@ export class 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) {
|
||||
super(path, child, auxiliary, params);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import {CONST_EXPR} from "angular2/src/facade/lang";
|
||||
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)
|
||||
// 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()
|
||||
export class Serializer {
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import {MessageBasedPlatformLocation} from './platform_location';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {
|
||||
BrowserPlatformLocation
|
||||
} from 'angular2/src/platform/browser/location/browser_platform_location';
|
||||
import {APP_INITIALIZER, Provider, Injector, NgZone} from 'angular2/core';
|
||||
|
||||
export const WORKER_RENDER_ROUTER = CONST_EXPR([
|
||||
export const WORKER_RENDER_ROUTER = /*@ts2dart_const*/[
|
||||
MessageBasedPlatformLocation,
|
||||
BrowserPlatformLocation,
|
||||
CONST_EXPR(
|
||||
new Provider(APP_INITIALIZER,
|
||||
{useFactory: initRouterListeners, multi: true, deps: CONST_EXPR([Injector])}))
|
||||
]);
|
||||
new Provider(APP_INITIALIZER, {useFactory: initRouterListeners, multi: true, deps: [Injector]})
|
||||
];
|
||||
|
||||
function initRouterListeners(injector: Injector): () => void {
|
||||
return () => {
|
||||
|
|
|
@ -46,7 +46,6 @@ import {
|
|||
import {By} from 'angular2/platform/browser';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {PromiseWrapper} from "angular2/src/facade/promise";
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -14,12 +14,12 @@ import {
|
|||
inject
|
||||
} from 'angular2/testing_internal';
|
||||
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 {TimerWrapper, ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
||||
|
||||
export function main() {
|
||||
function asyncValidator(expected, timeouts = CONST_EXPR({})) {
|
||||
function asyncValidator(expected, timeouts = /*@ts2dart_const*/ {}) {
|
||||
return (c) => {
|
||||
var completer = PromiseWrapper.completer();
|
||||
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 {PromiseWrapper} from 'angular2/src/facade/promise';
|
||||
import {EventEmitter, ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
export function main() {
|
||||
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 {TEST_PROVIDERS} from './test_bindings';
|
||||
import {isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {isPresent} from 'angular2/src/facade/lang';
|
||||
import {
|
||||
TemplateParser,
|
||||
splitClasses,
|
||||
|
@ -506,8 +506,8 @@ export function main() {
|
|||
}
|
||||
|
||||
function createProvider(
|
||||
token: string, {multi = false, deps = CONST_EXPR([])}:
|
||||
{multi?: boolean, deps?: string[]} = {}): CompileProviderMetadata {
|
||||
token: string, {multi = false, deps = /*@ts2dart_const*/[
|
||||
]}: {multi?: boolean, deps?: string[]} = {}): CompileProviderMetadata {
|
||||
return new CompileProviderMetadata({
|
||||
token: createToken(token),
|
||||
multi: multi,
|
||||
|
@ -516,13 +516,14 @@ export function main() {
|
|||
});
|
||||
}
|
||||
|
||||
function createDir(selector: string, {providers = null, viewProviders = null,
|
||||
deps = CONST_EXPR([]), queries = CONST_EXPR([])}: {
|
||||
providers?: CompileProviderMetadata[],
|
||||
viewProviders?: CompileProviderMetadata[],
|
||||
deps?: string[],
|
||||
queries?: string[]
|
||||
} = {}): CompileDirectiveMetadata {
|
||||
function createDir(selector: string,
|
||||
{providers = null, viewProviders = null, deps = /*@ts2dart_const*/[],
|
||||
queries = /*@ts2dart_const*/[]}: {
|
||||
providers?: CompileProviderMetadata[],
|
||||
viewProviders?: CompileProviderMetadata[],
|
||||
deps?: string[],
|
||||
queries?: string[]
|
||||
} = {}): CompileDirectiveMetadata {
|
||||
var isComponent = !selector.startsWith('[');
|
||||
return CompileDirectiveMetadata.create({
|
||||
selector: selector,
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import {isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {isBlank} from 'angular2/src/facade/lang';
|
||||
|
||||
export function iterableChangesAsString(
|
||||
{collection = CONST_EXPR([]), previous = CONST_EXPR([]), additions = CONST_EXPR([]),
|
||||
moves = CONST_EXPR([]), removals = CONST_EXPR([]), identityChanges = CONST_EXPR([])}) {
|
||||
{collection = /*@ts2dart_const*/[], previous = /*@ts2dart_const*/[],
|
||||
additions = /*@ts2dart_const*/[], moves = /*@ts2dart_const*/[],
|
||||
removals = /*@ts2dart_const*/[], identityChanges = /*@ts2dart_const*/[]}) {
|
||||
return "collection: " + collection.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" +
|
||||
"additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" +
|
||||
"removals: " + removals.join(', ') + "\n" + "identityChanges: " +
|
||||
|
|
|
@ -17,7 +17,6 @@ import {
|
|||
|
||||
import {
|
||||
IS_DART,
|
||||
CONST_EXPR,
|
||||
Type,
|
||||
isPresent,
|
||||
isBlank,
|
||||
|
@ -1072,8 +1071,8 @@ export function main() {
|
|||
});
|
||||
}
|
||||
|
||||
const ALL_DIRECTIVES = CONST_EXPR([
|
||||
forwardRef(() => TestDirective),
|
||||
const ALL_DIRECTIVES = /*@ts2dart_const*/ [
|
||||
forwardRef(( => TestDirective),
|
||||
forwardRef(() => TestComponent),
|
||||
forwardRef(() => AnotherComponent),
|
||||
forwardRef(() => TestLocals),
|
||||
|
@ -1085,8 +1084,8 @@ const ALL_DIRECTIVES = CONST_EXPR([
|
|||
forwardRef(() => OrderCheckDirective1),
|
||||
]);
|
||||
|
||||
const ALL_PIPES = CONST_EXPR([
|
||||
forwardRef(() => CountingPipe),
|
||||
const ALL_PIPES = /*@ts2dart_const*/ [
|
||||
forwardRef(( => CountingPipe),
|
||||
forwardRef(() => CountingImpurePipe),
|
||||
forwardRef(() => MultiArgPipe),
|
||||
forwardRef(() => PipeWithOnDestroy),
|
||||
|
|
|
@ -32,7 +32,6 @@ import {
|
|||
stringify,
|
||||
isBlank,
|
||||
CONST,
|
||||
CONST_EXPR,
|
||||
IS_DART
|
||||
} from 'angular2/src/facade/lang';
|
||||
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';
|
||||
|
||||
const ANCHOR_ELEMENT = CONST_EXPR(new OpaqueToken('AnchorElement'));
|
||||
const ANCHOR_ELEMENT = /*@ts2dart_const*/ new OpaqueToken('AnchorElement');
|
||||
|
||||
export function main() {
|
||||
if (IS_DART) {
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
fakeAsync,
|
||||
tick
|
||||
} 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 {
|
||||
ViewContainerRef,
|
||||
TemplateRef,
|
||||
|
@ -49,8 +49,8 @@ import {
|
|||
import {NgIf} from 'angular2/common';
|
||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||
|
||||
const ALL_DIRECTIVES = CONST_EXPR([
|
||||
forwardRef(() => SimpleDirective),
|
||||
const ALL_DIRECTIVES = /*@ts2dart_const*/ [
|
||||
forwardRef(( => SimpleDirective),
|
||||
forwardRef(() => CycleDirective),
|
||||
forwardRef(() => SimpleComponent),
|
||||
forwardRef(() => SomeOtherDirective),
|
||||
|
@ -83,8 +83,8 @@ const ALL_DIRECTIVES = CONST_EXPR([
|
|||
NgIf
|
||||
]);
|
||||
|
||||
const ALL_PIPES = CONST_EXPR([
|
||||
forwardRef(() => PipeNeedsChangeDetectorRef),
|
||||
const ALL_PIPES = /*@ts2dart_const*/ [
|
||||
forwardRef(( => PipeNeedsChangeDetectorRef),
|
||||
forwardRef(() => PipeNeedsService),
|
||||
forwardRef(() => PurePipe),
|
||||
forwardRef(() => ImpurePipe),
|
||||
|
|
|
@ -4,7 +4,6 @@ import {
|
|||
RegExpWrapper,
|
||||
RegExpMatcherWrapper,
|
||||
StringWrapper,
|
||||
CONST_EXPR,
|
||||
hasConstructor,
|
||||
resolveEnumToken
|
||||
} from 'angular2/src/facade/lang';
|
||||
|
@ -52,7 +51,7 @@ export function main() {
|
|||
|
||||
describe('const', () => {
|
||||
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]);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -12,7 +12,6 @@ import {
|
|||
} from 'angular2/testing_internal';
|
||||
|
||||
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 {Unparser} from '../../compiler/expression_parser/unparser';
|
||||
|
@ -64,4 +63,4 @@ export function main() {
|
|||
.toThrowErrorWith("Invalid router link");
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import {
|
|||
} from 'angular2/testing_internal';
|
||||
|
||||
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 {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
|
||||
|
@ -22,7 +21,8 @@ export function main() {
|
|||
|
||||
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.internalBaseHref = baseHref;
|
||||
let injector = ReflectiveInjector.resolveAndCreate(
|
||||
|
|
|
@ -12,7 +12,6 @@ import {
|
|||
} from 'angular2/testing_internal';
|
||||
|
||||
import {Injector, provide} from 'angular2/core';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
import {
|
||||
PlatformLocation,
|
||||
|
|
|
@ -19,7 +19,6 @@ import {
|
|||
import {UiArguments} from 'angular2/src/web_workers/shared/client_message_broker';
|
||||
import {Type} from 'angular2/src/facade/lang';
|
||||
import {PromiseWrapper} from "angular2/src/facade/async";
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
export function main() {
|
||||
describe("WebWorkerPlatformLocation", () => {
|
||||
|
|
|
@ -2,8 +2,6 @@ import {bootstrap} from 'angular2/platform/browser';
|
|||
import {Component, Directive, Host, forwardRef, Provider, Injectable} from 'angular2/core';
|
||||
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:
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
NgForm
|
||||
} 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.
|
||||
|
|
Loading…
Reference in New Issue