chore: replace @CONST() with /*@ts2dart_const*/

This commit is contained in:
Misko Hevery 2016-04-25 21:58:48 -07:00 committed by Martin Probst
parent a02614beaa
commit 3aa322a9c6
55 changed files with 240 additions and 246 deletions

View File

@ -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<any /*Type | Provider | any[]*/> = /*@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())) {

View File

@ -49,21 +49,21 @@ function createNgZone(): NgZone {
export const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@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<any /*Type | Provider | any[]*/> =
/*@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<any /*Type | Provider | an
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [
BROWSER_APP_COMMON_PROVIDERS,
new Provider(XHR, {useClass: XHRImpl},
/*@ts2dart_Provider*/{provide: XHR, useClass: XHRImpl},
ADDITIONAL_TEST_BROWSER_PROVIDERS
]);
];

View File

@ -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<any /*Type | Provider | any[]*/> =
/*@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<any /*Type | Provider | an
// list here.
APPLICATION_COMMON_PROVIDERS,
COMPILER_PROVIDERS,
new Provider(DOCUMENT, {useFactory: appDoc}),
new Provider(DomRootRenderer, {useClass: DomRootRenderer_}),
new Provider(RootRenderer, {useExisting: DomRootRenderer}),
/*@ts2dart_Provider*/{provide: DOCUMENT, useFactory: appDoc},
/*@ts2dart_Provider*/{provide: DomRootRenderer, useClass: DomRootRenderer_},
/*@ts2dart_Provider*/{provide: RootRenderer, useExisting: DomRootRenderer},
EventManager,
new Provider(EVENT_MANAGER_PLUGINS, {useClass: DomEventsPlugin, multi: true}),
new Provider(XHR, {useClass: XHR}),
new Provider(APP_ID, {useValue: 'a'}),
new Provider(SharedStylesHost, {useExisting: DomSharedStylesHost}),
/*@ts2dart_Provider*/{provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true},
/*@ts2dart_Provider*/{provide: XHR, useClass: XHR},
/*@ts2dart_Provider*/{provide: APP_ID, useValue: 'a'},
/*@ts2dart_Provider*/{provide: SharedStylesHost, useExisting: DomSharedStylesHost},
DomSharedStylesHost,
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},
];

View File

@ -1,11 +1,11 @@
import {CONST, Type, stringify} from "angular2/src/facade/lang";
import {Type, stringify} from "angular2/src/facade/lang";
export abstract class RouteMetadata {
abstract get path(): string;
abstract get component(): Type;
}
@CONST()
/* @ts2dart_const */
export class Route implements RouteMetadata {
path: string;
component: Type;
@ -16,8 +16,8 @@ export class Route implements RouteMetadata {
toString(): string { return `@Route(${this.path}, ${stringify(this.component)})`; }
}
@CONST()
/* @ts2dart_const */
export class RoutesMetadata {
constructor(public routes: RouteMetadata[]) {}
toString(): string { return `@Routes(${this.routes})`; }
}
}

View File

@ -1,12 +1,10 @@
import {ROUTER_PROVIDERS_COMMON} from './router_providers_common';
import {Provider} from 'angular2/core';
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';
export const ROUTER_PROVIDERS: any[] = CONST_EXPR([
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
ROUTER_PROVIDERS_COMMON,
CONST_EXPR(new Provider(PlatformLocation, {useClass: BrowserPlatformLocation})),
]);
/*@ts2dart_Provider*/{provide: PlatformLocation, useClass: BrowserPlatformLocation},
];

View File

@ -2,27 +2,20 @@ import {OpaqueToken, ComponentResolver} from 'angular2/core';
import {LocationStrategy, PathLocationStrategy, Location} from 'angular2/platform/common';
import {Router, RouterOutletMap} from './router';
import {RouterUrlSerializer, DefaultRouterUrlSerializer} from './router_url_serializer';
import {CONST_EXPR} from 'angular2/src/facade/lang';
import {ApplicationRef, Provider} from 'angular2/core';
import {ApplicationRef} from 'angular2/core';
import {BaseException} from 'angular2/src/facade/exceptions';
export const ROUTER_PROVIDERS_COMMON: any[] = CONST_EXPR([
export const ROUTER_PROVIDERS_COMMON: any[] = /*@ts2dart_const*/[
RouterOutletMap,
CONST_EXPR(new Provider(RouterUrlSerializer, {useClass: DefaultRouterUrlSerializer})),
CONST_EXPR(new Provider(LocationStrategy, {useClass: PathLocationStrategy})),
Location,
CONST_EXPR(new Provider(Router,
{
useFactory: routerFactory,
deps: CONST_EXPR([
ApplicationRef,
ComponentResolver,
RouterUrlSerializer,
RouterOutletMap,
Location
])
}))
]);
/*@ts2dart_Provider*/ {provide: RouterUrlSerializer, useClass: DefaultRouterUrlSerializer},
/*@ts2dart_Provider*/ {provide: LocationStrategy, useClass: PathLocationStrategy}, Location,
/*@ts2dart_Provider*/ {
provide: Router,
useFactory: routerFactory,
deps: /*@ts2dart_const*/
[ApplicationRef, ComponentResolver, RouterUrlSerializer, RouterOutletMap, Location],
},
];
function routerFactory(app: ApplicationRef, componentResolver: ComponentResolver,
urlSerializer: RouterUrlSerializer, routerOutletMap: RouterOutletMap,

View File

@ -1,9 +1,12 @@
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
import {Directive, ElementRef, Renderer, Self, forwardRef} from 'angular2/core';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
import {isBlank, NumberWrapper} from 'angular2/src/facade/lang';
export const NUMBER_VALUE_ACCESSOR = /*@ts2dart_const*/ new Provider(
NG_VALUE_ACCESSOR, {useExisting: forwardRef(( => 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

View File

@ -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.

View File

@ -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}`;

View File

@ -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 {
* <input [ngControl]="fullName" pattern="[a-zA-Z ]*">
* ```
*/
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]

View File

@ -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';

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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';

View File

@ -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 {

View File

@ -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[]> = /*@ts2dart_const*/ [
export const COMPILER_PROVIDERS: Array<any | Type | Provider | any[]> = /*@ts2dart_const*/ [
Lexer,
Parser,
HtmlParser,
@ -50,13 +50,13 @@ export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = /*@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
]);
];

View File

@ -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) => {

View File

@ -5,7 +5,6 @@ import {
MapWrapper
} from 'angular2/src/facade/collection';
import {
CONST_EXPR,
RegExpWrapper,
isPresent,
StringWrapper,

View File

@ -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<Type | Provider | any[]> = /*@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<any | Type | Provider | any[]> =
/*@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_},
];

View File

@ -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 {

View File

@ -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';

View File

@ -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[]) {}

View File

@ -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[]) {}

View File

@ -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()`; }
}

View File

@ -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) {}

View File

@ -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,

View File

@ -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';

View File

@ -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';

View File

@ -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) {}

View File

@ -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}) {}

View File

@ -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.

View File

@ -16,7 +16,6 @@ import {
Type,
isArray,
isNumber,
CONST,
stringify,
isPrimitive,
isString

View File

@ -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});

View File

@ -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 `<li></li>` which is a sibling to the `<template>` 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[]) {}
}

View File

@ -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.

View File

@ -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<Type | Provider | any[]> = /*@ts2dart_const*/ [
export const PLATFORM_COMMON_PROVIDERS: Array<any | Type | Provider | any[]> = /*@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
]);
];

View File

@ -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,

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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';

View File

@ -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<any /*Type | Provider | any[]*/> = /*@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<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}),
/*@ts2dart_Provider*/{provide: PLATFORM_PIPES, useValue: COMMON_PIPES, multi: true},
/*@ts2dart_Provider*/{provide: PLATFORM_DIRECTIVES, useValue: COMMON_DIRECTIVES, multi: true},
/*@ts2dart_Provider*/{provide: ExceptionHandler, useFactory: _exceptionHandler, deps: []},
/*@ts2dart_Provider*/{provide: DOCUMENT, useFactory: _document, deps: []},
/*@ts2dart_Provider*/{provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true},
/*@ts2dart_Provider*/{provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true},
/*@ts2dart_Provider*/{provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true},
/*@ts2dart_Provider*/{provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig},
/*@ts2dart_Provider*/{provide: DomRootRenderer, useClass: DomRootRenderer_},
/*@ts2dart_Provider*/{provide: RootRenderer, useExisting: DomRootRenderer},
/*@ts2dart_Provider*/{provide: SharedStylesHost, useExisting: DomSharedStylesHost},
DomSharedStylesHost,
Testability,
BrowserDetails,
AnimationBuilder,
EventManager,
ELEMENT_PROBE_PROVIDERS
]);
];
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [new Provider(XHR, {useClass: CachedXHR}]);
/*@ts2dart_const*/ [/*@ts2dart_Provider*/{provide: XHR, useClass: CachedXHR}];
export function initDomAdapter() {
BrowserDomAdapter.makeCurrent();

View File

@ -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]
}
];

View File

@ -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<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]})
]);
export const WORKER_RENDER_APPLICATION: Array<any /*Type | Provider | any[]*/> = /*@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;

View File

@ -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) {}
}

View File

@ -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<any> = 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<Type>;
aux: string = null;
@ -175,7 +175,7 @@ export class AsyncRoute extends AbstractRoute {
* class MyApp {}
* ```
*/
@CONST()
/* @ts2dart_const */
export class Redirect extends AbstractRoute {
redirectTo: any[];

View File

@ -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';
/**

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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: `(<li1></li1>)(<li2></li2>)`, directives: [LIST_CHILDREN]})