chore: replace @CONST() with /*@ts2dart_const*/
This commit is contained in:
committed by
Martin Probst
parent
a02614beaa
commit
3aa322a9c6
@@ -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())) {
|
||||
|
||||
@@ -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
|
||||
]);
|
||||
];
|
||||
|
||||
@@ -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},
|
||||
];
|
||||
|
||||
@@ -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})`; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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},
|
||||
];
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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}`;
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
]);
|
||||
];
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
MapWrapper
|
||||
} from 'angular2/src/facade/collection';
|
||||
import {
|
||||
CONST_EXPR,
|
||||
RegExpWrapper,
|
||||
isPresent,
|
||||
StringWrapper,
|
||||
|
||||
@@ -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_},
|
||||
];
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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[]) {}
|
||||
|
||||
|
||||
@@ -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[]) {}
|
||||
|
||||
|
||||
@@ -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()`; }
|
||||
}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user