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 `