diff --git a/modules/angular2/platform/browser.ts b/modules/angular2/platform/browser.ts
index 344430965d..664ce42396 100644
--- a/modules/angular2/platform/browser.ts
+++ b/modules/angular2/platform/browser.ts
@@ -34,7 +34,6 @@ import {
import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities';
import {XHRImpl} from "angular2/src/platform/browser/xhr_impl";
import {XHR} from 'angular2/compiler';
-import {Provider} from 'angular2/src/core/di';
/**
* An array of providers that should be passed into `application()` when bootstrapping a component.
@@ -42,8 +41,8 @@ import {Provider} from 'angular2/src/core/di';
export const BROWSER_APP_PROVIDERS: Array = /*@ts2dart_const*/ [
BROWSER_APP_COMMON_PROVIDERS,
COMPILER_PROVIDERS,
- new Provider(XHR, {useClass: XHRImpl},
-]);
+ /*@ts2dart_Provider*/{provide: XHR, useClass: XHRImpl},
+];
export function browserPlatform(): PlatformRef {
if (isBlank(getPlatform())) {
diff --git a/modules/angular2/platform/testing/browser_static.ts b/modules/angular2/platform/testing/browser_static.ts
index 37ead07c68..9f97e6aa4b 100644
--- a/modules/angular2/platform/testing/browser_static.ts
+++ b/modules/angular2/platform/testing/browser_static.ts
@@ -49,21 +49,21 @@ function createNgZone(): NgZone {
export const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array =
/*@ts2dart_const*/ [
PLATFORM_COMMON_PROVIDERS,
- new Provider(PLATFORM_INITIALIZER, {useValue: initBrowserTests, multi: true}
- ]);
+ /*@ts2dart_Provider*/{provide: PLATFORM_INITIALIZER, useValue: initBrowserTests, multi: true}
+ ];
export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array =
/*@ts2dart_const*/ [
- new Provider(APP_ID, {useValue: 'a'},
+ /*@ts2dart_Provider*/{provide: APP_ID, useValue: 'a'},
ELEMENT_PROBE_PROVIDERS,
- new Provider(DirectiveResolver, {useClass: MockDirectiveResolver}),
- new Provider(ViewResolver, {useClass: MockViewResolver}),
+ /*@ts2dart_Provider*/{provide: DirectiveResolver, useClass: MockDirectiveResolver},
+ /*@ts2dart_Provider*/{provide: ViewResolver, useClass: MockViewResolver},
Log,
TestComponentBuilder,
- new Provider(NgZone, {useFactory: createNgZone}),
- new Provider(LocationStrategy, {useClass: MockLocationStrategy}),
- new Provider(AnimationBuilder, {useClass: MockAnimationBuilder}),
- ]);
+ /*@ts2dart_Provider*/{provide: NgZone, useFactory: createNgZone},
+ /*@ts2dart_Provider*/{provide: LocationStrategy, useClass: MockLocationStrategy},
+ /*@ts2dart_Provider*/{provide: AnimationBuilder, useClass: MockAnimationBuilder},
+ ];
/**
* Default application providers for testing without a compiler.
@@ -71,6 +71,6 @@ export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array =
/*@ts2dart_const*/ [
BROWSER_APP_COMMON_PROVIDERS,
- new Provider(XHR, {useClass: XHRImpl},
+ /*@ts2dart_Provider*/{provide: XHR, useClass: XHRImpl},
ADDITIONAL_TEST_BROWSER_PROVIDERS
- ]);
+ ];
diff --git a/modules/angular2/platform/testing/server.ts b/modules/angular2/platform/testing/server.ts
index 306ce49136..b9e6f8c221 100644
--- a/modules/angular2/platform/testing/server.ts
+++ b/modules/angular2/platform/testing/server.ts
@@ -1,7 +1,6 @@
import {
APP_ID,
NgZone,
- Provider,
PLATFORM_COMMON_PROVIDERS,
PLATFORM_INITIALIZER,
APPLICATION_COMMON_PROVIDERS,
@@ -52,8 +51,8 @@ function initServerTests() {
export const TEST_SERVER_PLATFORM_PROVIDERS: Array =
/*@ts2dart_const*/ [
PLATFORM_COMMON_PROVIDERS,
- new Provider(PLATFORM_INITIALIZER, {useValue: initServerTests, multi: true}
- ]);
+ /*@ts2dart_Provider*/{provide: PLATFORM_INITIALIZER, useValue: initServerTests, multi: true}
+ ];
function appDoc() {
try {
@@ -72,21 +71,21 @@ export const TEST_SERVER_APPLICATION_PROVIDERS: Array NumberValueAccessor), multi: true}));
+export const NUMBER_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
+ provide: NG_VALUE_ACCESSOR,
+ useExisting: forwardRef(() => NumberValueAccessor),
+ multi: true
+};
/**
* The accessor for writing a number value and listening to changes that is used by the
diff --git a/modules/angular2/src/common/forms/directives/radio_control_value_accessor.ts b/modules/angular2/src/common/forms/directives/radio_control_value_accessor.ts
index 25a53bb1b9..b94e355b06 100644
--- a/modules/angular2/src/common/forms/directives/radio_control_value_accessor.ts
+++ b/modules/angular2/src/common/forms/directives/radio_control_value_accessor.ts
@@ -20,9 +20,11 @@ import {NgControl} from 'angular2/src/common/forms/directives/ng_control';
import {looseIdentical, isPresent} from 'angular2/src/facade/lang';
import {ListWrapper} from 'angular2/src/facade/collection';
-export const RADIO_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
- NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => RadioControlValueAccessor), multi: true}));
-
+export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
+ povide: NG_VALUE_ACCESSOR,
+ useExisting: forwardRef(() => RadioControlValueAccessor),
+ multi: true
+};
/**
* Internal class used by Angular to uncheck radio buttons with the matching name.
diff --git a/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts b/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts
index 8d99d3addc..ec29c0035a 100644
--- a/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts
+++ b/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts
@@ -20,8 +20,11 @@ import {
import {MapWrapper} from 'angular2/src/facade/collection';
-export const SELECT_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
- NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => SelectControlValueAccessor), multi: true}));
+export const SELECT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
+ provide: NG_VALUE_ACCESSOR,
+ useExisting: forwardRef(() => SelectControlValueAccessor),
+ multi: true
+};
function _buildValueString(id: string, value: any): string {
if (isBlank(id)) return `${value}`;
diff --git a/modules/angular2/src/common/forms/directives/validators.ts b/modules/angular2/src/common/forms/directives/validators.ts
index 161970440f..ecb30498ef 100644
--- a/modules/angular2/src/common/forms/directives/validators.ts
+++ b/modules/angular2/src/common/forms/directives/validators.ts
@@ -1,4 +1,4 @@
-import {forwardRef, Provider, Attribute, Directive} from 'angular2/core';
+import {forwardRef, Attribute, Directive} from 'angular2/core';
import {NumberWrapper} from 'angular2/src/facade/lang';
import {Validators, NG_VALIDATORS} from '../validators';
import {AbstractControl} from '../model';
@@ -27,8 +27,11 @@ export interface Validator { validate(c: modelModule.AbstractControl): {[key: st
const REQUIRED = /*@ts2dart_const*/ Validators.required;
-export const REQUIRED_VALIDATOR =
- /*@ts2dart_const*/ new Provider(NG_VALIDATORS, {useValue: REQUIRED, multi: true});
+export const REQUIRED_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
+ provide: NG_VALIDATORS,
+ useValue: REQUIRED,
+ multi: true
+};
/**
* A Directive that adds the `required` validator to any controls marked with the
@@ -59,8 +62,12 @@ export interface AsyncValidatorFn {
*
* {@example common/forms/ts/validators/validators.ts region='min'}
*/
-export const MIN_LENGTH_VALIDATOR = /*@ts2dart_const*/
- new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => MinLengthValidator), multi: true}));
+export const MIN_LENGTH_VALIDATOR: any = /*@ts2dart_const*/
+ /*@ts2dart_Provider*/ {
+ provide: NG_VALIDATORS,
+ useExisting: forwardRef(() => MinLengthValidator),
+ multi: true
+ };
/**
* A directive which installs the {@link MinLengthValidator} for any `ngControl`,
@@ -87,8 +94,12 @@ export class MinLengthValidator implements Validator {
*
* {@example common/forms/ts/validators/validators.ts region='max'}
*/
-export const MAX_LENGTH_VALIDATOR = /*@ts2dart_const*/
- new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => MaxLengthValidator), multi: true}));
+export const MAX_LENGTH_VALIDATOR: any = /*@ts2dart_const*/
+ /*@ts2dart_Provider*/ {
+ provide: NG_VALIDATORS,
+ useExisting: forwardRef(() => MaxLengthValidator),
+ multi: true
+ };
/**
* A directive which installs the {@link MaxLengthValidator} for any `ngControl, `ngFormControl`,
@@ -121,8 +132,12 @@ export class MaxLengthValidator implements Validator {
*
* ```
*/
-export const PATTERN_VALIDATOR = /*@ts2dart_const*/
- new Provider(NG_VALIDATORS, {useExisting: forwardRef(( => PatternValidator), multi: true}));
+export const PATTERN_VALIDATOR: any = /*@ts2dart_const*/
+ /*@ts2dart_Provider*/ {
+ provide: NG_VALIDATORS,
+ useExisting: forwardRef(() => PatternValidator),
+ multi: true
+ };
@Directive({
selector: '[pattern][ngControl],[pattern][ngFormControl],[pattern][ngModel]',
providers: [PATTERN_VALIDATOR]
diff --git a/modules/angular2/src/common/pipes/async_pipe.ts b/modules/angular2/src/common/pipes/async_pipe.ts
index b91130c693..1aa6502ac3 100644
--- a/modules/angular2/src/common/pipes/async_pipe.ts
+++ b/modules/angular2/src/common/pipes/async_pipe.ts
@@ -1,4 +1,4 @@
-import {isBlank, isPresent, isPromise, CONST} from 'angular2/src/facade/lang';
+import {isBlank, isPresent, isPromise} from 'angular2/src/facade/lang';
import {ObservableWrapper, Observable, EventEmitter} from 'angular2/src/facade/async';
import {Pipe, Injectable, ChangeDetectorRef, OnDestroy, WrappedValue} from 'angular2/core';
diff --git a/modules/angular2/src/common/pipes/date_pipe.ts b/modules/angular2/src/common/pipes/date_pipe.ts
index 9ebab2e547..29de777981 100644
--- a/modules/angular2/src/common/pipes/date_pipe.ts
+++ b/modules/angular2/src/common/pipes/date_pipe.ts
@@ -4,7 +4,6 @@ import {
isPresent,
Date,
DateWrapper,
- CONST,
isBlank,
FunctionWrapper
} from 'angular2/src/facade/lang';
@@ -84,7 +83,7 @@ var defaultLocale: string = 'en-US';
*
* {@example core/pipes/ts/date_pipe/date_pipe_example.ts region='DatePipe'}
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'date', pure: true})
@Injectable()
export class DatePipe implements PipeTransform {
diff --git a/modules/angular2/src/common/pipes/i18n_plural_pipe.ts b/modules/angular2/src/common/pipes/i18n_plural_pipe.ts
index 0959931b48..11c6a4ccfe 100644
--- a/modules/angular2/src/common/pipes/i18n_plural_pipe.ts
+++ b/modules/angular2/src/common/pipes/i18n_plural_pipe.ts
@@ -1,10 +1,4 @@
-import {
- CONST,
- isStringMap,
- StringWrapper,
- isPresent,
- RegExpWrapper
-} from 'angular2/src/facade/lang';
+import {isStringMap, StringWrapper, isPresent, RegExpWrapper} from 'angular2/src/facade/lang';
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
@@ -41,7 +35,7 @@ var interpolationExp: RegExp = RegExpWrapper.create('#');
* ```
*
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'i18nPlural', pure: true})
@Injectable()
export class I18nPluralPipe implements PipeTransform {
diff --git a/modules/angular2/src/common/pipes/i18n_select_pipe.ts b/modules/angular2/src/common/pipes/i18n_select_pipe.ts
index b5a627303d..18aae6d79a 100644
--- a/modules/angular2/src/common/pipes/i18n_select_pipe.ts
+++ b/modules/angular2/src/common/pipes/i18n_select_pipe.ts
@@ -1,4 +1,4 @@
-import {CONST, isStringMap} from 'angular2/src/facade/lang';
+import {isStringMap} from 'angular2/src/facade/lang';
import {StringMapWrapper} from 'angular2/src/facade/collection';
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
@@ -32,7 +32,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
* }
* ```
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'i18nSelect', pure: true})
@Injectable()
export class I18nSelectPipe implements PipeTransform {
diff --git a/modules/angular2/src/common/pipes/invalid_pipe_argument_exception.ts b/modules/angular2/src/common/pipes/invalid_pipe_argument_exception.ts
index b3a8311f90..76a16ee1ef 100644
--- a/modules/angular2/src/common/pipes/invalid_pipe_argument_exception.ts
+++ b/modules/angular2/src/common/pipes/invalid_pipe_argument_exception.ts
@@ -1,4 +1,4 @@
-import {CONST, Type, stringify} from 'angular2/src/facade/lang';
+import {Type, stringify} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
export class InvalidPipeArgumentException extends BaseException {
diff --git a/modules/angular2/src/common/pipes/json_pipe.ts b/modules/angular2/src/common/pipes/json_pipe.ts
index 63b251915f..4684355bae 100644
--- a/modules/angular2/src/common/pipes/json_pipe.ts
+++ b/modules/angular2/src/common/pipes/json_pipe.ts
@@ -1,4 +1,4 @@
-import {isBlank, isPresent, Json, CONST} from 'angular2/src/facade/lang';
+import {isBlank, isPresent, Json} from 'angular2/src/facade/lang';
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
/**
@@ -7,7 +7,7 @@ import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
* ### Example
* {@example core/pipes/ts/json_pipe/json_pipe_example.ts region='JsonPipe'}
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'json', pure: false})
@Injectable()
export class JsonPipe implements PipeTransform {
diff --git a/modules/angular2/src/common/pipes/lowercase_pipe.ts b/modules/angular2/src/common/pipes/lowercase_pipe.ts
index ddc27a9b9a..d00eee11c8 100644
--- a/modules/angular2/src/common/pipes/lowercase_pipe.ts
+++ b/modules/angular2/src/common/pipes/lowercase_pipe.ts
@@ -1,4 +1,4 @@
-import {isString, CONST, isBlank} from 'angular2/src/facade/lang';
+import {isString, isBlank} from 'angular2/src/facade/lang';
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
@@ -9,7 +9,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
*
* {@example core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts region='LowerUpperPipe'}
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'lowercase'})
@Injectable()
export class LowerCasePipe implements PipeTransform {
diff --git a/modules/angular2/src/common/pipes/number_pipe.ts b/modules/angular2/src/common/pipes/number_pipe.ts
index 2aaef1b3bc..5bc326f661 100644
--- a/modules/angular2/src/common/pipes/number_pipe.ts
+++ b/modules/angular2/src/common/pipes/number_pipe.ts
@@ -5,7 +5,6 @@ import {
StringWrapper,
NumberWrapper,
RegExpWrapper,
- CONST,
FunctionWrapper
} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
@@ -20,7 +19,7 @@ var _re = RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$');
/**
* Internal base class for numeric pipes.
*/
-@CONST()
+/* @ts2dart_const */
@Injectable()
export class NumberPipe {
/** @internal */
@@ -82,7 +81,7 @@ export class NumberPipe {
*
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='NumberPipe'}
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'number'})
@Injectable()
export class DecimalPipe extends NumberPipe implements PipeTransform {
@@ -107,7 +106,7 @@ export class DecimalPipe extends NumberPipe implements PipeTransform {
*
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='PercentPipe'}
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'percent'})
@Injectable()
export class PercentPipe extends NumberPipe implements PipeTransform {
@@ -136,7 +135,7 @@ export class PercentPipe extends NumberPipe implements PipeTransform {
*
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='CurrencyPipe'}
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'currency'})
@Injectable()
export class CurrencyPipe extends NumberPipe implements PipeTransform {
diff --git a/modules/angular2/src/common/pipes/slice_pipe.ts b/modules/angular2/src/common/pipes/slice_pipe.ts
index 2e55b63b74..4e87ae21e2 100644
--- a/modules/angular2/src/common/pipes/slice_pipe.ts
+++ b/modules/angular2/src/common/pipes/slice_pipe.ts
@@ -1,4 +1,4 @@
-import {isBlank, isString, isArray, StringWrapper, CONST} from 'angular2/src/facade/lang';
+import {isBlank, isString, isArray, StringWrapper} from 'angular2/src/facade/lang';
import {ListWrapper} from 'angular2/src/facade/collection';
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
diff --git a/modules/angular2/src/common/pipes/uppercase_pipe.ts b/modules/angular2/src/common/pipes/uppercase_pipe.ts
index 37cb97dcd5..de5d56fe8e 100644
--- a/modules/angular2/src/common/pipes/uppercase_pipe.ts
+++ b/modules/angular2/src/common/pipes/uppercase_pipe.ts
@@ -1,4 +1,4 @@
-import {isString, CONST, isBlank} from 'angular2/src/facade/lang';
+import {isString, isBlank} from 'angular2/src/facade/lang';
import {PipeTransform, WrappedValue, Injectable, Pipe} from 'angular2/core';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
@@ -9,7 +9,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
*
* {@example core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts region='LowerUpperPipe'}
*/
-@CONST()
+/* @ts2dart_const */
@Pipe({name: 'uppercase'})
@Injectable()
export class UpperCasePipe implements PipeTransform {
diff --git a/modules/angular2/src/compiler/compiler.ts b/modules/angular2/src/compiler/compiler.ts
index b8e7d24199..28538bc5b6 100644
--- a/modules/angular2/src/compiler/compiler.ts
+++ b/modules/angular2/src/compiler/compiler.ts
@@ -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 = /*@ts2dart_const*/ [
+export const COMPILER_PROVIDERS: Array = /*@ts2dart_const*/ [
Lexer,
Parser,
HtmlParser,
@@ -50,13 +50,13 @@ export const COMPILER_PROVIDERS: Array = /*@ts2dart_con
DEFAULT_PACKAGE_URL_PROVIDER,
StyleCompiler,
ViewCompiler,
- new Provider(CompilerConfig, {useFactory: _createCompilerConfig, deps: []},
+ /*@ts2dart_Provider*/{provide: CompilerConfig, useFactory: _createCompilerConfig, deps: []},
RuntimeCompiler,
- new Provider(ComponentResolver, {useExisting: RuntimeCompiler}),
+ /*@ts2dart_Provider*/{provide: ComponentResolver, useExisting: RuntimeCompiler},
DomElementSchemaRegistry,
- new Provider(ElementSchemaRegistry, {useExisting: DomElementSchemaRegistry}),
+ /*@ts2dart_Provider*/{provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry},
UrlResolver,
ViewResolver,
DirectiveResolver,
PipeResolver
-]);
+];
diff --git a/modules/angular2/src/compiler/static_reflector.ts b/modules/angular2/src/compiler/static_reflector.ts
index 09e59619c2..010ef26a0e 100644
--- a/modules/angular2/src/compiler/static_reflector.ts
+++ b/modules/angular2/src/compiler/static_reflector.ts
@@ -5,7 +5,6 @@ import {
isBlank,
isPrimitive,
isStringMap,
- CONST_EXPR,
FunctionWrapper
} from 'angular2/src/facade/lang';
import {
@@ -155,7 +154,7 @@ export class StaticReflector implements ReflectorReader {
}
private registerDecoratorOrConstructor(type: StaticSymbol, ctor: any,
- crossModuleProps: any[] = CONST_EXPR([])): void {
+ crossModuleProps: any[] = []): void {
this.conversionMap.set(type, (moduleContext: ModuleContext, args: any[]) => {
let argValues = [];
ListWrapper.forEachWithIndex(args, (arg, index) => {
diff --git a/modules/angular2/src/compiler/template_parser.ts b/modules/angular2/src/compiler/template_parser.ts
index 9680f1d94b..757ebd66ac 100644
--- a/modules/angular2/src/compiler/template_parser.ts
+++ b/modules/angular2/src/compiler/template_parser.ts
@@ -5,7 +5,6 @@ import {
MapWrapper
} from 'angular2/src/facade/collection';
import {
- CONST_EXPR,
RegExpWrapper,
isPresent,
StringWrapper,
diff --git a/modules/angular2/src/core/application_common_providers.ts b/modules/angular2/src/core/application_common_providers.ts
index 7fece17eb5..3d62057c45 100644
--- a/modules/angular2/src/core/application_common_providers.ts
+++ b/modules/angular2/src/core/application_common_providers.ts
@@ -12,18 +12,19 @@ import {ViewUtils} from "./linker/view_utils";
import {ComponentResolver, ReflectorComponentResolver} from './linker/component_resolver';
import {DynamicComponentLoader, DynamicComponentLoader_} from './linker/dynamic_component_loader';
-var __unused: Type; // avoid unused import when Type union types are erased
+let __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 = /*@ts2dart_const*/ [
- APPLICATION_CORE_PROVIDERS,
- 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_})
-]);
+export const APPLICATION_COMMON_PROVIDERS: Array =
+ /*@ts2dart_const*/[
+ APPLICATION_CORE_PROVIDERS,
+ /*@ts2dart_const*/ {provide: ComponentResolver, useClass: ReflectorComponentResolver},
+ APP_ID_RANDOM_PROVIDER,
+ ViewUtils,
+ /*@ts2dart_const*/ {provide: IterableDiffers, useValue: defaultIterableDiffers},
+ /*@ts2dart_const*/ {provide: KeyValueDiffers, useValue: defaultKeyValueDiffers},
+ /*@ts2dart_const*/ {provide: DynamicComponentLoader, useClass: DynamicComponentLoader_},
+ ];
diff --git a/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts b/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts
index a028232949..a37dfd11ae 100644
--- a/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts
+++ b/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts
@@ -2,7 +2,6 @@ import {BaseException} from 'angular2/src/facade/exceptions';
import {isListLikeIterable, iterateListLike, ListWrapper} from 'angular2/src/facade/collection';
import {
- CONST,
isBlank,
isPresent,
stringify,
@@ -14,7 +13,7 @@ import {
import {ChangeDetectorRef} from '../change_detector_ref';
import {IterableDiffer, IterableDifferFactory, TrackByFn} from '../differs/iterable_differs';
-@CONST()
+/* @ts2dart_const */
export class DefaultIterableDifferFactory implements IterableDifferFactory {
supports(obj: Object): boolean { return isListLikeIterable(obj); }
create(cdRef: ChangeDetectorRef, trackByFn?: TrackByFn): DefaultIterableDiffer {
diff --git a/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts b/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts
index 360e430556..8e71077ef3 100644
--- a/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts
+++ b/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts
@@ -1,5 +1,5 @@
import {MapWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
-import {stringify, looseIdentical, isJsObject, CONST, isBlank} from 'angular2/src/facade/lang';
+import {stringify, looseIdentical, isJsObject, isBlank} from 'angular2/src/facade/lang';
import {BaseException} from 'angular2/src/facade/exceptions';
import {ChangeDetectorRef} from '../change_detector_ref';
import {KeyValueDiffer, KeyValueDifferFactory} from '../differs/keyvalue_differs';
diff --git a/modules/angular2/src/core/change_detection/differs/iterable_differs.ts b/modules/angular2/src/core/change_detection/differs/iterable_differs.ts
index 757b833c9a..d6d73df68e 100644
--- a/modules/angular2/src/core/change_detection/differs/iterable_differs.ts
+++ b/modules/angular2/src/core/change_detection/differs/iterable_differs.ts
@@ -1,4 +1,4 @@
-import {isBlank, isPresent, CONST, getTypeNameForDebugging} from 'angular2/src/facade/lang';
+import {isBlank, isPresent, getTypeNameForDebugging} from 'angular2/src/facade/lang';
import {BaseException} from 'angular2/src/facade/exceptions';
import {ListWrapper} from 'angular2/src/facade/collection';
import {ChangeDetectorRef} from '../change_detector_ref';
@@ -32,7 +32,7 @@ export interface IterableDifferFactory {
* A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
* @ts2dart_const
*/
-@CONST()
+/* @ts2dart_const */
export class IterableDiffers {
constructor(public factories: IterableDifferFactory[]) {}
diff --git a/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts b/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts
index 6cc4cc869d..627a777d99 100644
--- a/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts
+++ b/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts
@@ -1,4 +1,4 @@
-import {isBlank, isPresent, CONST} from 'angular2/src/facade/lang';
+import {isBlank, isPresent} from 'angular2/src/facade/lang';
import {BaseException} from 'angular2/src/facade/exceptions';
import {ListWrapper} from 'angular2/src/facade/collection';
import {ChangeDetectorRef} from '../change_detector_ref';
@@ -24,7 +24,7 @@ export interface KeyValueDifferFactory {
* A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
* @ts2dart_const
*/
-@CONST()
+/* @ts2dart_const */
export class KeyValueDiffers {
constructor(public factories: KeyValueDifferFactory[]) {}
diff --git a/modules/angular2/src/core/di/metadata.ts b/modules/angular2/src/core/di/metadata.ts
index 7e322f9073..b7eb809a0f 100644
--- a/modules/angular2/src/core/di/metadata.ts
+++ b/modules/angular2/src/core/di/metadata.ts
@@ -1,4 +1,4 @@
-import {CONST, stringify, isBlank, isPresent} from "angular2/src/facade/lang";
+import {stringify, isBlank, isPresent} from "angular2/src/facade/lang";
/**
* A parameter metadata that specifies a dependency.
@@ -40,7 +40,7 @@ import {CONST, stringify, isBlank, isPresent} from "angular2/src/facade/lang";
* expect(injector.get(Car).engine instanceof Engine).toBe(true);
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class InjectMetadata {
constructor(public token) {}
toString(): string { return `@Inject(${stringify(this.token)})`; }
@@ -67,7 +67,7 @@ export class InjectMetadata {
* expect(injector.get(Car).engine).toBeNull();
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class OptionalMetadata {
toString(): string { return `@Optional()`; }
}
@@ -76,7 +76,7 @@ export class OptionalMetadata {
* `DependencyMetadata` is used by the framework to extend DI.
* This is internal to Angular and should not be used directly.
*/
-@CONST()
+/* @ts2dart_const */
export class DependencyMetadata {
get token() { return null; }
}
@@ -112,7 +112,7 @@ export class DependencyMetadata {
* expect(() => injector.get(NeedsService)).toThrowError();
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class InjectableMetadata {
constructor() {}
}
@@ -144,7 +144,7 @@ export class InjectableMetadata {
* expect(() => child.get(NeedsDependency)).toThrowError();
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class SelfMetadata {
toString(): string { return `@Self()`; }
}
@@ -174,7 +174,7 @@ export class SelfMetadata {
* expect(() => inj.get(NeedsDependency)).toThrowError();
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class SkipSelfMetadata {
toString(): string { return `@SkipSelf()`; }
}
@@ -233,7 +233,7 @@ export class SkipSelfMetadata {
* bootstrap(App);
*```
*/
-@CONST()
+/* @ts2dart_const */
export class HostMetadata {
toString(): string { return `@Host()`; }
}
diff --git a/modules/angular2/src/core/di/opaque_token.ts b/modules/angular2/src/core/di/opaque_token.ts
index 3216bff532..170f6bbb32 100644
--- a/modules/angular2/src/core/di/opaque_token.ts
+++ b/modules/angular2/src/core/di/opaque_token.ts
@@ -1,4 +1,3 @@
-import {CONST} from 'angular2/src/facade/lang';
/**
* Creates a token that can be used in a DI Provider.
@@ -21,7 +20,7 @@ import {CONST} from 'angular2/src/facade/lang';
* Using an `OpaqueToken` is preferable to using an `Object` as tokens because it provides better
* error messages.
*/
-@CONST()
+/* @ts2dart_const */
export class OpaqueToken {
constructor(private _desc: string) {}
diff --git a/modules/angular2/src/core/di/provider.ts b/modules/angular2/src/core/di/provider.ts
index 376646d25d..876dd1d3bc 100644
--- a/modules/angular2/src/core/di/provider.ts
+++ b/modules/angular2/src/core/di/provider.ts
@@ -1,7 +1,6 @@
import {
normalizeBool,
Type,
- CONST,
isType,
isBlank,
isFunction,
@@ -24,7 +23,7 @@ import {BaseException} from 'angular2/src/facade/exceptions';
* expect(injector.get("message")).toEqual('Hello');
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class Provider {
/**
* Token used when retrieving this provider. Usually, it is a type {@link Type}.
@@ -210,7 +209,7 @@ export class Provider {
*
* @deprecated
*/
-@CONST()
+/* @ts2dart_const */
export class Binding extends Provider {
constructor(token, {toClass, toValue, toAlias, toFactory, deps, multi}: {
toClass?: Type,
diff --git a/modules/angular2/src/core/di/reflective_key.ts b/modules/angular2/src/core/di/reflective_key.ts
index 7dc50757db..6e45293622 100644
--- a/modules/angular2/src/core/di/reflective_key.ts
+++ b/modules/angular2/src/core/di/reflective_key.ts
@@ -1,4 +1,4 @@
-import {stringify, CONST, Type, isBlank} from 'angular2/src/facade/lang';
+import {stringify, Type, isBlank} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {resolveForwardRef} from './forward_ref';
diff --git a/modules/angular2/src/core/di/reflective_provider.ts b/modules/angular2/src/core/di/reflective_provider.ts
index adace53bea..6154914e48 100644
--- a/modules/angular2/src/core/di/reflective_provider.ts
+++ b/modules/angular2/src/core/di/reflective_provider.ts
@@ -1,4 +1,4 @@
-import {Type, isBlank, isPresent, CONST, isArray, isType} from 'angular2/src/facade/lang';
+import {Type, isBlank, isPresent, 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';
diff --git a/modules/angular2/src/core/linker/component_factory.ts b/modules/angular2/src/core/linker/component_factory.ts
index 121f1b5023..46f7db0c4f 100644
--- a/modules/angular2/src/core/linker/component_factory.ts
+++ b/modules/angular2/src/core/linker/component_factory.ts
@@ -1,5 +1,5 @@
import {Injector} from 'angular2/src/core/di';
-import {Type, CONST, CONST_EXPR, isPresent, isBlank} from 'angular2/src/facade/lang';
+import {Type, isPresent, isBlank} from 'angular2/src/facade/lang';
import {unimplemented} from 'angular2/src/facade/exceptions';
import {ElementRef} from './element_ref';
import {ViewRef, ViewRef_} from './view_ref';
@@ -69,13 +69,8 @@ export class ComponentRef_ extends ComponentRef {
onDestroy(callback: Function): void { this.hostView.onDestroy(callback); }
}
-<<<<<<< HEAD
-const EMPTY_CONTEXT = CONST_EXPR(new Object());
+const EMPTY_CONTEXT = /*@ts2dart_const*/new Object();
-@CONST()
-=======
-/* @ts2dart_const */
->>>>>>> 176ffd8... chore: upgrade to ts2dart@0.9.9
export class ComponentFactory {
constructor(public selector: string, private _viewFactory: Function,
private _componentType: Type) {}
diff --git a/modules/angular2/src/core/linker/debug_context.ts b/modules/angular2/src/core/linker/debug_context.ts
index d5e1b134fa..e6ab2208a5 100644
--- a/modules/angular2/src/core/linker/debug_context.ts
+++ b/modules/angular2/src/core/linker/debug_context.ts
@@ -1,11 +1,11 @@
-import {isPresent, isBlank, CONST} from 'angular2/src/facade/lang';
+import {isPresent, isBlank} from 'angular2/src/facade/lang';
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
import {Injector} from 'angular2/src/core/di';
import {RenderDebugInfo} from 'angular2/src/core/render/api';
import {DebugAppView} from './view';
import {ViewType} from './view_type';
-@CONST()
+/* @ts2dart_const */
export class StaticNodeDebugInfo {
constructor(public providerTokens: any[], public componentToken: any,
public refTokens: {[key: string]: any}) {}
diff --git a/modules/angular2/src/core/linker/template_ref.ts b/modules/angular2/src/core/linker/template_ref.ts
index 6a62e8e8ba..c80fb66682 100644
--- a/modules/angular2/src/core/linker/template_ref.ts
+++ b/modules/angular2/src/core/linker/template_ref.ts
@@ -1,10 +1,10 @@
-import {CONST_EXPR, isBlank} from 'angular2/src/facade/lang';
+import {isBlank} from 'angular2/src/facade/lang';
import {ElementRef} from './element_ref';
import {AppElement} from './element';
import {AppView} from './view';
import {EmbeddedViewRef} from './view_ref';
-const EMPTY_CONTEXT = CONST_EXPR(new Object());
+const EMPTY_CONTEXT = /*@ts2dart_const*/ new Object();
/**
* Represents an Embedded Template that can be used to instantiate Embedded Views.
diff --git a/modules/angular2/src/core/linker/view.ts b/modules/angular2/src/core/linker/view.ts
index ef8d19ee6b..df8b280dae 100644
--- a/modules/angular2/src/core/linker/view.ts
+++ b/modules/angular2/src/core/linker/view.ts
@@ -16,7 +16,6 @@ import {
Type,
isArray,
isNumber,
- CONST,
stringify,
isPrimitive,
isString
diff --git a/modules/angular2/src/core/metadata/di.ts b/modules/angular2/src/core/metadata/di.ts
index 62484bddf4..4743971c48 100644
--- a/modules/angular2/src/core/metadata/di.ts
+++ b/modules/angular2/src/core/metadata/di.ts
@@ -1,4 +1,4 @@
-import {CONST, Type, stringify, isPresent, isString} from 'angular2/src/facade/lang';
+import {Type, stringify, isPresent, isString} from 'angular2/src/facade/lang';
import {resolveForwardRef} from 'angular2/src/core/di';
import {DependencyMetadata} from 'angular2/src/core/di/metadata';
@@ -19,7 +19,7 @@ import {DependencyMetadata} from 'angular2/src/core/di/metadata';
*
* {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
*/
-@CONST()
+/* @ts2dart_const */
export class AttributeMetadata extends DependencyMetadata {
constructor(public attributeName: string) { super(); }
@@ -141,7 +141,7 @@ export class AttributeMetadata extends DependencyMetadata {
* The injected object is an unmodifiable live list.
* See {@link QueryList} for more details.
*/
-@CONST()
+/* @ts2dart_const */
export class QueryMetadata extends DependencyMetadata {
/**
* whether we want to query only direct children (false) or all
@@ -208,7 +208,7 @@ export class QueryMetadata extends DependencyMetadata {
* }
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class ContentChildrenMetadata extends QueryMetadata {
constructor(_selector: Type | string,
{descendants = false, read = null}: {descendants?: boolean, read?: any} = {}) {
@@ -237,7 +237,7 @@ export class ContentChildrenMetadata extends QueryMetadata {
* }
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class ContentChildMetadata extends QueryMetadata {
constructor(_selector: Type | string, {read = null}: {read?: any} = {}) {
super(_selector, {descendants: true, first: true, read: read});
@@ -279,7 +279,7 @@ export class ContentChildMetadata extends QueryMetadata {
* The injected object is an iterable and observable live list.
* See {@link QueryList} for more details.
*/
-@CONST()
+/* @ts2dart_const */
export class ViewQueryMetadata extends QueryMetadata {
constructor(_selector: Type | string,
{descendants = false, first = false,
@@ -371,7 +371,7 @@ export class ViewQueryMetadata extends QueryMetadata {
* }
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class ViewChildrenMetadata extends ViewQueryMetadata {
constructor(_selector: Type | string, {read = null}: {read?: any} = {}) {
super(_selector, {descendants: true, read: read});
@@ -448,7 +448,7 @@ export class ViewChildrenMetadata extends ViewQueryMetadata {
* }
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class ViewChildMetadata extends ViewQueryMetadata {
constructor(_selector: Type | string, {read = null}: {read?: any} = {}) {
super(_selector, {descendants: true, first: true, read: read});
diff --git a/modules/angular2/src/core/metadata/directives.ts b/modules/angular2/src/core/metadata/directives.ts
index 687cc8f8c6..575eb74acd 100644
--- a/modules/angular2/src/core/metadata/directives.ts
+++ b/modules/angular2/src/core/metadata/directives.ts
@@ -1,4 +1,4 @@
-import {isPresent, CONST, Type} from 'angular2/src/facade/lang';
+import {isPresent, 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';
@@ -381,7 +381,7 @@ import {ViewEncapsulation} from 'angular2/src/core/metadata/view';
* the instantiated
* view occurs on the second `` which is a sibling to the `` element.
*/
-@CONST()
+/* @ts2dart_const */
export class DirectiveMetadata extends InjectableMetadata {
/**
* The CSS selector that triggers the instantiation of a directive.
@@ -784,7 +784,7 @@ export class DirectiveMetadata extends InjectableMetadata {
*
* {@example core/ts/metadata/metadata.ts region='component'}
*/
-@CONST()
+/* @ts2dart_const */
export class ComponentMetadata extends DirectiveMetadata {
/**
* Defines the used change detection strategy.
@@ -941,7 +941,7 @@ export class ComponentMetadata extends DirectiveMetadata {
*
* {@example core/ts/metadata/metadata.ts region='pipe'}
*/
-@CONST()
+/* @ts2dart_const */
export class PipeMetadata extends InjectableMetadata {
name: string;
/** @internal */
@@ -997,7 +997,7 @@ export class PipeMetadata extends InjectableMetadata {
* bootstrap(App);
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class InputMetadata {
constructor(
/**
@@ -1047,7 +1047,7 @@ export class InputMetadata {
* bootstrap(App);
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class OutputMetadata {
constructor(public bindingPropertyName?: string) {}
}
@@ -1087,7 +1087,7 @@ export class OutputMetadata {
* bootstrap(App);
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class HostBindingMetadata {
constructor(public hostPropertyName?: string) {}
}
@@ -1126,7 +1126,7 @@ export class HostBindingMetadata {
* bootstrap(App);
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class HostListenerMetadata {
constructor(public eventName: string, public args?: string[]) {}
}
diff --git a/modules/angular2/src/core/metadata/view.ts b/modules/angular2/src/core/metadata/view.ts
index efd2dc6fd3..502f60dc43 100644
--- a/modules/angular2/src/core/metadata/view.ts
+++ b/modules/angular2/src/core/metadata/view.ts
@@ -1,4 +1,4 @@
-import {CONST, Type} from 'angular2/src/facade/lang';
+import {Type} from 'angular2/src/facade/lang';
/**
* Defines template and style encapsulation options available for Component's {@link View}.
@@ -61,7 +61,7 @@ export var VIEW_ENCAPSULATION_VALUES =
* }
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class ViewMetadata {
/**
* Specifies a template URL for an Angular component.
diff --git a/modules/angular2/src/core/platform_common_providers.ts b/modules/angular2/src/core/platform_common_providers.ts
index 382d7ac303..7798547af1 100644
--- a/modules/angular2/src/core/platform_common_providers.ts
+++ b/modules/angular2/src/core/platform_common_providers.ts
@@ -10,13 +10,15 @@ function _reflector(): Reflector {
return reflector;
}
+var __unused: Type; // prevent missing use Dart warning.
+
/**
* A default set of providers which should be included in any Angular platform.
*/
-export const PLATFORM_COMMON_PROVIDERS: Array = /*@ts2dart_const*/ [
+export const PLATFORM_COMMON_PROVIDERS: Array = /*@ts2dart_const*/[
PLATFORM_CORE_PROVIDERS,
- new Provider(Reflector, {useFactory: _reflector, deps: []},
- new Provider(ReflectorReader, {useExisting: Reflector}),
+ /*@ts2dart_Provider*/ {provide: Reflector, useFactory: _reflector, deps: []},
+ /*@ts2dart_Provider*/ {provide: ReflectorReader, useExisting: Reflector},
TestabilityRegistry,
Console
-]);
+];
diff --git a/modules/angular2/src/core/testability/testability.ts b/modules/angular2/src/core/testability/testability.ts
index 3b08601490..3a68fd3e89 100644
--- a/modules/angular2/src/core/testability/testability.ts
+++ b/modules/angular2/src/core/testability/testability.ts
@@ -1,6 +1,6 @@
import {Injectable} from 'angular2/src/core/di';
import {Map, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
-import {CONST, scheduleMicroTask} from 'angular2/src/facade/lang';
+import {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';
@@ -134,7 +134,7 @@ export interface GetTestability {
findInAncestors: boolean): Testability;
}
-@CONST()
+/* @ts2dart_const */
class _NoopGetTestability implements GetTestability {
addToWindow(registry: TestabilityRegistry): void {}
findTestabilityInTree(registry: TestabilityRegistry, elem: any,
diff --git a/modules/angular2/src/facade/lang.dart b/modules/angular2/src/facade/lang.dart
index 313dc69d3b..b03a7114f9 100644
--- a/modules/angular2/src/facade/lang.dart
+++ b/modules/angular2/src/facade/lang.dart
@@ -14,10 +14,6 @@ class Math {
static num min(num a, num b) => math.min(a, b);
}
-class CONST {
- const CONST();
-}
-
const IS_DART = true;
scheduleMicroTask(Function fn) {
@@ -398,4 +394,4 @@ num bitWiseAnd(List values) {
String escape(String s) {
return Uri.encodeComponent(s);
-}
\ No newline at end of file
+}
diff --git a/modules/angular2/src/facade/lang.ts b/modules/angular2/src/facade/lang.ts
index 69481c5460..3c0de8f692 100644
--- a/modules/angular2/src/facade/lang.ts
+++ b/modules/angular2/src/facade/lang.ts
@@ -106,10 +106,6 @@ _global.assert = function assert(condition) {
// TODO: to be fixed properly via #2830, noop for now
};
-export function CONST(): ClassDecorator & PropertyDecorator {
- return (target) => target;
-}
-
export function isPresent(obj: any): boolean {
return obj !== undefined && obj !== null;
}
diff --git a/modules/angular2/src/platform/browser/testability.ts b/modules/angular2/src/platform/browser/testability.ts
index 6499935dcf..35aae2f264 100644
--- a/modules/angular2/src/platform/browser/testability.ts
+++ b/modules/angular2/src/platform/browser/testability.ts
@@ -1,5 +1,5 @@
import {Map, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
-import {CONST, global, isPresent} from 'angular2/src/facade/lang';
+import {global, isPresent} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {PromiseWrapper, ObservableWrapper} from 'angular2/src/facade/async';
diff --git a/modules/angular2/src/platform/browser_common.ts b/modules/angular2/src/platform/browser_common.ts
index 0b9e98704c..5a4175fee9 100644
--- a/modules/angular2/src/platform/browser_common.ts
+++ b/modules/angular2/src/platform/browser_common.ts
@@ -1,5 +1,5 @@
import {IS_DART} from 'angular2/src/facade/lang';
-import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
+import {provide, Injector, OpaqueToken} from 'angular2/src/core/di';
import {XHR} from 'angular2/src/compiler/xhr';
import {
PLATFORM_INITIALIZER,
@@ -55,10 +55,10 @@ export const BROWSER_PLATFORM_MARKER =
* Used automatically by `bootstrap`, or can be passed to {@link platform}.
*/
export const BROWSER_PROVIDERS: Array = /*@ts2dart_const*/ [
- new Provider(BROWSER_PLATFORM_MARKER, {useValue: true},
+ /*@ts2dart_Provider*/{provide: BROWSER_PLATFORM_MARKER, useValue: true},
PLATFORM_COMMON_PROVIDERS,
- new Provider(PLATFORM_INITIALIZER, {useValue: initDomAdapter, multi: true}),
-]);
+ /*@ts2dart_Provider*/{provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true},
+];
function _exceptionHandler(): ExceptionHandler {
// !IS_DART is required because we must rethrow exceptions in JS,
@@ -79,27 +79,27 @@ export const BROWSER_APP_COMMON_PROVIDERS: Array =
- /*@ts2dart_const*/ [new Provider(XHR, {useClass: CachedXHR}]);
+ /*@ts2dart_const*/ [/*@ts2dart_Provider*/{provide: XHR, useClass: CachedXHR}];
export function initDomAdapter() {
BrowserDomAdapter.makeCurrent();
diff --git a/modules/angular2/src/platform/dom/debug/ng_probe.ts b/modules/angular2/src/platform/dom/debug/ng_probe.ts
index f5d7ab4e88..77a289488b 100644
--- a/modules/angular2/src/platform/dom/debug/ng_probe.ts
+++ b/modules/angular2/src/platform/dom/debug/ng_probe.ts
@@ -1,5 +1,5 @@
import {assertionsEnabled, isPresent} from 'angular2/src/facade/lang';
-import {Injectable, provide, Provider} from 'angular2/src/core/di';
+import {Injectable, provide} from 'angular2/src/core/di';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {DebugNode, getDebugNode} from 'angular2/src/core/debug/debug_node';
import {DomRootRenderer} from 'angular2/src/platform/dom/dom_renderer';
@@ -36,10 +36,18 @@ function _createRootRenderer(rootRenderer) {
/**
* Providers which support debugging Angular applications (e.g. via `ng.probe`).
*/
-export const ELEMENT_PROBE_PROVIDERS: any[] = /*@ts2dart_const*/ [
- new Provider(RootRenderer,
- {useFactory: _createConditionalRootRenderer, deps: [DomRootRenderer]}
-]);
+export const ELEMENT_PROBE_PROVIDERS: any[] = /*@ts2dart_const*/[
+ /*@ts2dart_Provider*/ {
+ provide: RootRenderer,
+ useFactory: _createConditionalRootRenderer,
+ deps: [DomRootRenderer]
+ }
+];
-export const ELEMENT_PROBE_PROVIDERS_PROD_MODE: any[] = /*@ts2dart_const*/
- [new Provider(RootRenderer, {useFactory: _createRootRenderer, deps: [DomRootRenderer]}]);
+export const ELEMENT_PROBE_PROVIDERS_PROD_MODE: any[] = /*@ts2dart_const*/[
+ /*@ts2dart_Provider*/ {
+ provide: RootRenderer,
+ useFactory: _createRootRenderer,
+ deps: [DomRootRenderer]
+ }
+];
diff --git a/modules/angular2/src/platform/worker_render.ts b/modules/angular2/src/platform/worker_render.ts
index fdfcee762e..98802e2c23 100644
--- a/modules/angular2/src/platform/worker_render.ts
+++ b/modules/angular2/src/platform/worker_render.ts
@@ -35,19 +35,20 @@ export class WebWorkerInstance {
/**
* An array of providers that should be passed into `application()` when initializing a new Worker.
*/
-export const WORKER_RENDER_APPLICATION: Array =
- /*@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]})
- ]);
+export const WORKER_RENDER_APPLICATION: Array = /*@ts2dart_const*/[
+ WORKER_RENDER_APPLICATION_COMMON, WebWorkerInstance,
+ /*@ts2dart_Provider*/ {
+ provide: APP_INITIALIZER,
+ useFactory: (injector => () => initWebWorkerApplication(injector)),
+ multi: true,
+ deps: [Injector]
+ },
+ /*@ts2dart_Provider*/ {
+ provide: MessageBus,
+ useFactory: (instance) => instance.bus,
+ deps: [WebWorkerInstance]
+ }
+];
function initWebWorkerApplication(injector: Injector): void {
var scriptUri: string;
diff --git a/modules/angular2/src/router/lifecycle/lifecycle_annotations_impl.ts b/modules/angular2/src/router/lifecycle/lifecycle_annotations_impl.ts
index 710387e46b..27da913192 100644
--- a/modules/angular2/src/router/lifecycle/lifecycle_annotations_impl.ts
+++ b/modules/angular2/src/router/lifecycle/lifecycle_annotations_impl.ts
@@ -1,11 +1,10 @@
-import {CONST} from 'angular2/src/facade/lang';
-@CONST()
+/* @ts2dart_const */
export class RouteLifecycleHook {
constructor(public name: string) {}
}
-@CONST()
+/* @ts2dart_const */
export class CanActivate {
constructor(public fn: Function) {}
}
diff --git a/modules/angular2/src/router/route_config/route_config_impl.ts b/modules/angular2/src/router/route_config/route_config_impl.ts
index 22a115757f..cf5d86ac8c 100644
--- a/modules/angular2/src/router/route_config/route_config_impl.ts
+++ b/modules/angular2/src/router/route_config/route_config_impl.ts
@@ -1,4 +1,4 @@
-import {CONST, Type, isPresent} from 'angular2/src/facade/lang';
+import {Type, isPresent} from 'angular2/src/facade/lang';
import {RouteDefinition} from '../route_definition';
import {RegexSerializer} from '../rules/route_paths/regex_route_path';
@@ -11,12 +11,12 @@ var __make_dart_analyzer_happy: Promise = null;
*
* It takes an array of {@link RouteDefinition}s.
*/
-@CONST()
+/* @ts2dart_const */
export class RouteConfig {
constructor(public configs: RouteDefinition[]) {}
}
-@CONST()
+/* @ts2dart_const */
export abstract class AbstractRoute implements RouteDefinition {
name: string;
useAsDefault: boolean;
@@ -57,7 +57,7 @@ export abstract class AbstractRoute implements RouteDefinition {
* class MyApp {}
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class Route extends AbstractRoute {
component: any;
aux: string = null;
@@ -95,7 +95,7 @@ export class Route extends AbstractRoute {
* class MyApp {}
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class AuxRoute extends AbstractRoute {
component: any;
@@ -136,7 +136,7 @@ export class AuxRoute extends AbstractRoute {
* class MyApp {}
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class AsyncRoute extends AbstractRoute {
loader: () => Promise;
aux: string = null;
@@ -175,7 +175,7 @@ export class AsyncRoute extends AbstractRoute {
* class MyApp {}
* ```
*/
-@CONST()
+/* @ts2dart_const */
export class Redirect extends AbstractRoute {
redirectTo: any[];
diff --git a/modules/angular2/src/router/route_definition.ts b/modules/angular2/src/router/route_definition.ts
index 233b20230a..594a5eff07 100644
--- a/modules/angular2/src/router/route_definition.ts
+++ b/modules/angular2/src/router/route_definition.ts
@@ -1,4 +1,4 @@
-import {CONST, Type} from 'angular2/src/facade/lang';
+import {Type} from 'angular2/src/facade/lang';
import {RegexSerializer} from './rules/route_paths/regex_route_path';
/**
diff --git a/modules/angular2/test/core/linker/change_detection_integration_spec.ts b/modules/angular2/test/core/linker/change_detection_integration_spec.ts
index 46f0141c34..f3236a4b1a 100644
--- a/modules/angular2/test/core/linker/change_detection_integration_spec.ts
+++ b/modules/angular2/test/core/linker/change_detection_integration_spec.ts
@@ -1072,7 +1072,7 @@ export function main() {
}
const ALL_DIRECTIVES = /*@ts2dart_const*/ [
- forwardRef(( => TestDirective),
+ forwardRef(() => TestDirective),
forwardRef(() => TestComponent),
forwardRef(() => AnotherComponent),
forwardRef(() => TestLocals),
@@ -1082,17 +1082,17 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/ [
forwardRef(() => OrderCheckDirective2),
forwardRef(() => OrderCheckDirective0),
forwardRef(() => OrderCheckDirective1),
-]);
+];
const ALL_PIPES = /*@ts2dart_const*/ [
- forwardRef(( => CountingPipe),
+ forwardRef(() => CountingPipe),
forwardRef(() => CountingImpurePipe),
forwardRef(() => MultiArgPipe),
forwardRef(() => PipeWithOnDestroy),
forwardRef(() => IdentityPipe),
forwardRef(() => WrappedPipe),
AsyncPipe
-]);
+];
@Injectable()
class RenderLog {
diff --git a/modules/angular2/test/core/linker/integration_spec.ts b/modules/angular2/test/core/linker/integration_spec.ts
index fd9efc1f39..1346f1ecdd 100644
--- a/modules/angular2/test/core/linker/integration_spec.ts
+++ b/modules/angular2/test/core/linker/integration_spec.ts
@@ -31,7 +31,6 @@ import {
global,
stringify,
isBlank,
- CONST,
IS_DART
} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
@@ -2408,7 +2407,7 @@ class DirectiveConsumingInjectableUnbounded {
}
-@CONST()
+/* @ts2dart_const */
class EventBus {
parentEventBus: EventBus;
name: string;
diff --git a/modules/angular2/test/core/linker/view_injector_integration_spec.ts b/modules/angular2/test/core/linker/view_injector_integration_spec.ts
index 9337930bc7..afc8da29f1 100644
--- a/modules/angular2/test/core/linker/view_injector_integration_spec.ts
+++ b/modules/angular2/test/core/linker/view_injector_integration_spec.ts
@@ -50,7 +50,7 @@ import {NgIf} from 'angular2/common';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
const ALL_DIRECTIVES = /*@ts2dart_const*/ [
- forwardRef(( => SimpleDirective),
+ forwardRef(() => SimpleDirective),
forwardRef(() => CycleDirective),
forwardRef(() => SimpleComponent),
forwardRef(() => SomeOtherDirective),
@@ -81,16 +81,16 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/ [
forwardRef(() => PushComponentNeedsChangeDetectorRef),
forwardRef(() => NeedsHostAppService),
NgIf
-]);
+];
const ALL_PIPES = /*@ts2dart_const*/ [
- forwardRef(( => PipeNeedsChangeDetectorRef),
+ forwardRef(() => PipeNeedsChangeDetectorRef),
forwardRef(() => PipeNeedsService),
forwardRef(() => PurePipe),
forwardRef(() => ImpurePipe),
forwardRef(() => DuplicatePipe1),
forwardRef(() => DuplicatePipe2),
-]);
+];
@Directive({selector: '[simpleDirective]'})
class SimpleDirective {
diff --git a/modules/angular2/test/testing/test_component_builder_spec.ts b/modules/angular2/test/testing/test_component_builder_spec.ts
index fd36eed25a..295ed4e705 100644
--- a/modules/angular2/test/testing/test_component_builder_spec.ts
+++ b/modules/angular2/test/testing/test_component_builder_spec.ts
@@ -17,7 +17,6 @@ import {
ComponentFixtureNoNgZone
} from 'angular2/testing_internal';
-import {CONST_EXPR} from 'angular2/src/facade/lang';
import {Injectable, provide} from 'angular2/core';
import {NgIf} from 'angular2/common';
import {Directive, Component, ViewMetadata, Input} from 'angular2/src/core/metadata';
@@ -152,7 +151,7 @@ class ListDir1Alt {
class ListDir2 {
}
-const LIST_CHILDREN = CONST_EXPR([ListDir1, ListDir2]);
+const LIST_CHILDREN = /*@ts2dart_const*/[ListDir1, ListDir2];
@Component(
{selector: 'directive-list-comp', template: `()()`, directives: [LIST_CHILDREN]})