refactor: remove ts2dart annotations

This commit is contained in:
Victor Berchet 2016-07-30 19:18:14 -07:00
parent 13c8211065
commit 28c4852cd6
89 changed files with 344 additions and 489 deletions

View File

@ -55,4 +55,4 @@ import {CORE_DIRECTIVES} from './directives';
* *
* @experimental Contains forms which are experimental. * @experimental Contains forms which are experimental.
*/ */
export const COMMON_DIRECTIVES: Type[][] = /*@ts2dart_const*/[CORE_DIRECTIVES]; export const COMMON_DIRECTIVES: Type[][] = [CORE_DIRECTIVES];

View File

@ -58,7 +58,7 @@ import {NgTemplateOutlet} from './ng_template_outlet';
* *
* @stable * @stable
*/ */
export const CORE_DIRECTIVES: Type[] = /*@ts2dart_const*/[ export const CORE_DIRECTIVES: Type[] = [
NgClass, NgClass,
NgFor, NgFor,
NgIf, NgIf,

View File

@ -57,7 +57,7 @@ export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './forms-deprecated
* *
* @experimental * @experimental
*/ */
export const FORM_PROVIDERS: Type[] = /*@ts2dart_const*/[FormBuilder, RadioControlRegistry]; export const FORM_PROVIDERS: Type[] = [FormBuilder, RadioControlRegistry];
/** /**

View File

@ -58,7 +58,7 @@ export {MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValida
* ``` * ```
* @experimental * @experimental
*/ */
export const FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/[ export const FORM_DIRECTIVES: Type[] = [
NgControlName, NgControlName,
NgControlGroup, NgControlGroup,

View File

@ -10,7 +10,7 @@ import {Directive, ElementRef, Renderer, forwardRef} from '@angular/core';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const CHECKBOX_VALUE_ACCESSOR: any = /*@ts2dart_const*/ { export const CHECKBOX_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => CheckboxControlValueAccessor), useExisting: forwardRef(() => CheckboxControlValueAccessor),
multi: true multi: true

View File

@ -41,5 +41,4 @@ export interface ControlValueAccessor {
* See {@link DefaultValueAccessor} for how to implement one. * See {@link DefaultValueAccessor} for how to implement one.
* @experimental * @experimental
*/ */
export const NG_VALUE_ACCESSOR: OpaqueToken = export const NG_VALUE_ACCESSOR: OpaqueToken = new OpaqueToken('NgValueAccessor');
/*@ts2dart_const*/ new OpaqueToken('NgValueAccessor');

View File

@ -12,12 +12,11 @@ import {isBlank} from '../../facade/lang';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const DEFAULT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ export const DEFAULT_VALUE_ACCESSOR: any = {
/* @ts2dart_Provider */ { provide: NG_VALUE_ACCESSOR,
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DefaultValueAccessor),
useExisting: forwardRef(() => DefaultValueAccessor), multi: true
multi: true };
};
/** /**
* The default accessor for writing a value and listening to changes that is used by the * The default accessor for writing a value and listening to changes that is used by the

View File

@ -16,11 +16,10 @@ import {Form} from './form_interface';
import {composeAsyncValidators, composeValidators, controlPath} from './shared'; import {composeAsyncValidators, composeValidators, controlPath} from './shared';
import {AsyncValidatorFn, ValidatorFn} from './validators'; import {AsyncValidatorFn, ValidatorFn} from './validators';
export const controlGroupProvider: any = export const controlGroupProvider: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: ControlContainer,
provide: ControlContainer, useExisting: forwardRef(() => NgControlGroup)
useExisting: forwardRef(() => NgControlGroup) };
};
/** /**
* Creates and binds a control group to a DOM element. * Creates and binds a control group to a DOM element.

View File

@ -19,11 +19,10 @@ import {composeAsyncValidators, composeValidators, controlPath, isPropertyUpdate
import {AsyncValidatorFn, ValidatorFn} from './validators'; import {AsyncValidatorFn, ValidatorFn} from './validators';
export const controlNameBinding: any = export const controlNameBinding: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: NgControl,
provide: NgControl, useExisting: forwardRef(() => NgControlName)
useExisting: forwardRef(() => NgControlName) };
};
/** /**
* Creates and binds a control with a specified name to a DOM element. * Creates and binds a control with a specified name to a DOM element.

View File

@ -20,8 +20,10 @@ import {NgControl} from './ng_control';
import {NgControlGroup} from './ng_control_group'; import {NgControlGroup} from './ng_control_group';
import {composeAsyncValidators, composeValidators, setUpControl, setUpControlGroup} from './shared'; import {composeAsyncValidators, composeValidators, setUpControl, setUpControlGroup} from './shared';
export const formDirectiveProvider: any = export const formDirectiveProvider: any = {
/*@ts2dart_const*/ {provide: ControlContainer, useExisting: forwardRef(() => NgForm)}; provide: ControlContainer,
useExisting: forwardRef(() => NgForm)
};
let _formWarningDisplayed: boolean = false; let _formWarningDisplayed: boolean = false;

View File

@ -18,11 +18,10 @@ import {NgControl} from './ng_control';
import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from './shared'; import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from './shared';
import {AsyncValidatorFn, ValidatorFn} from './validators'; import {AsyncValidatorFn, ValidatorFn} from './validators';
export const formControlBinding: any = export const formControlBinding: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: NgControl,
provide: NgControl, useExisting: forwardRef(() => NgFormControl)
useExisting: forwardRef(() => NgFormControl) };
};
/** /**
* Binds an existing {@link Control} to a DOM element. * Binds an existing {@link Control} to a DOM element.

View File

@ -21,11 +21,10 @@ import {NgControl} from './ng_control';
import {NgControlGroup} from './ng_control_group'; import {NgControlGroup} from './ng_control_group';
import {composeAsyncValidators, composeValidators, setUpControl, setUpControlGroup} from './shared'; import {composeAsyncValidators, composeValidators, setUpControl, setUpControlGroup} from './shared';
export const formDirectiveProvider: any = export const formDirectiveProvider: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: ControlContainer,
provide: ControlContainer, useExisting: forwardRef(() => NgFormModel)
useExisting: forwardRef(() => NgFormModel) };
};
let _formModelWarningDisplayed: boolean = false; let _formModelWarningDisplayed: boolean = false;

View File

@ -17,11 +17,10 @@ import {NgControl} from './ng_control';
import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from './shared'; import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from './shared';
import {AsyncValidatorFn, ValidatorFn} from './validators'; import {AsyncValidatorFn, ValidatorFn} from './validators';
export const formControlBinding: any = export const formControlBinding: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: NgControl,
provide: NgControl, useExisting: forwardRef(() => NgModel)
useExisting: forwardRef(() => NgModel) };
};
/** /**
* Binds a domain model to a form control. * Binds a domain model to a form control.

View File

@ -12,7 +12,7 @@ import {NumberWrapper, isBlank} from '../../facade/lang';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const NUMBER_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const NUMBER_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => NumberValueAccessor), useExisting: forwardRef(() => NumberValueAccessor),
multi: true multi: true

View File

@ -14,7 +14,7 @@ import {isPresent} from '../../facade/lang';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
import {NgControl} from './ng_control'; import {NgControl} from './ng_control';
export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const RADIO_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => RadioControlValueAccessor), useExisting: forwardRef(() => RadioControlValueAccessor),
multi: true multi: true

View File

@ -13,7 +13,7 @@ import {StringWrapper, isBlank, isPresent, isPrimitive, looseIdentical} from '..
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const SELECT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const SELECT_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => SelectControlValueAccessor), useExisting: forwardRef(() => SelectControlValueAccessor),
multi: true multi: true

View File

@ -35,9 +35,9 @@ import {NG_VALIDATORS, Validators} from '../validators';
*/ */
export interface Validator { validate(c: AbstractControl): {[key: string]: any}; } export interface Validator { validate(c: AbstractControl): {[key: string]: any}; }
const REQUIRED = /*@ts2dart_const*/ Validators.required; const REQUIRED = Validators.required;
export const REQUIRED_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const REQUIRED_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useValue: REQUIRED, useValue: REQUIRED,
multi: true multi: true
@ -74,7 +74,7 @@ export interface AsyncValidatorFn {
* *
* {@example common/forms/ts/validators/validators.ts region='min'} * {@example common/forms/ts/validators/validators.ts region='min'}
*/ */
export const MIN_LENGTH_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const MIN_LENGTH_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useExisting: forwardRef(() => MinLengthValidator), useExisting: forwardRef(() => MinLengthValidator),
multi: true multi: true
@ -107,7 +107,7 @@ export class MinLengthValidator implements Validator {
* *
* {@example common/forms/ts/validators/validators.ts region='max'} * {@example common/forms/ts/validators/validators.ts region='max'}
*/ */
export const MAX_LENGTH_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const MAX_LENGTH_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useExisting: forwardRef(() => MaxLengthValidator), useExisting: forwardRef(() => MaxLengthValidator),
multi: true multi: true
@ -134,7 +134,7 @@ export class MaxLengthValidator implements Validator {
} }
export const PATTERN_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const PATTERN_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useExisting: forwardRef(() => PatternValidator), useExisting: forwardRef(() => PatternValidator),
multi: true multi: true

View File

@ -24,7 +24,7 @@ import {AbstractControl} from './model';
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'} * {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
* @experimental * @experimental
*/ */
export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('NgValidators'); export const NG_VALIDATORS: OpaqueToken = new OpaqueToken('NgValidators');
/** /**
* Providers for asynchronous validators to be used for {@link Control}s * Providers for asynchronous validators to be used for {@link Control}s
@ -36,8 +36,7 @@ export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Ng
* *
* @experimental * @experimental
*/ */
export const NG_ASYNC_VALIDATORS: OpaqueToken = export const NG_ASYNC_VALIDATORS: OpaqueToken = new OpaqueToken('NgAsyncValidators');
/*@ts2dart_const*/ new OpaqueToken('NgAsyncValidators');
/** /**
* Provides a set of validators used by form controls. * Provides a set of validators used by form controls.

View File

@ -69,4 +69,4 @@ export abstract class LocationStrategy {
* ``` * ```
* @stable * @stable
*/ */
export const APP_BASE_HREF: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('appBaseHref'); export const APP_BASE_HREF: OpaqueToken = new OpaqueToken('appBaseHref');

View File

@ -32,7 +32,7 @@ import {UpperCasePipe} from './uppercase_pipe';
* *
* @experimental Contains i18n pipes which are experimental * @experimental Contains i18n pipes which are experimental
*/ */
export const COMMON_PIPES = /*@ts2dart_const*/[ export const COMMON_PIPES = [
AsyncPipe, AsyncPipe,
UpperCasePipe, UpperCasePipe,
LowerCasePipe, LowerCasePipe,

View File

@ -1519,13 +1519,7 @@ function loginIsEmptyGroupValidator(c: ControlGroup) {
@Directive({ @Directive({
selector: '[login-is-empty-validator]', selector: '[login-is-empty-validator]',
providers: [ providers: [{provide: NG_VALIDATORS, useValue: loginIsEmptyGroupValidator, multi: true}]
/* @ts2dart_Provider */ {
provide: NG_VALIDATORS,
useValue: loginIsEmptyGroupValidator,
multi: true
}
]
}) })
class LoginIsEmptyValidator { class LoginIsEmptyValidator {
} }

View File

@ -14,7 +14,7 @@ import {PromiseWrapper} from '../../src/facade/promise';
import {TimerWrapper, ObservableWrapper, EventEmitter} from '../../src/facade/async'; import {TimerWrapper, ObservableWrapper, EventEmitter} from '../../src/facade/async';
export function main() { export function main() {
function asyncValidator(expected: any /** TODO #9100 */, timeouts = /*@ts2dart_const*/ {}) { function asyncValidator(expected: any /** TODO #9100 */, timeouts = {}) {
return (c: any /** TODO #9100 */) => { return (c: any /** TODO #9100 */) => {
var completer = PromiseWrapper.completer(); var completer = PromiseWrapper.completer();
var t = isPresent((timeouts as any /** TODO #9100 */)[c.value]) ? var t = isPresent((timeouts as any /** TODO #9100 */)[c.value]) ?

View File

@ -52,32 +52,31 @@ const _NO_XHR: XHR = {
* A set of providers that provide `RuntimeCompiler` and its dependencies to use for * A set of providers that provide `RuntimeCompiler` and its dependencies to use for
* template compilation. * template compilation.
*/ */
export const COMPILER_PROVIDERS: Array<any|Type|{[k: string]: any}|any[]> = export const COMPILER_PROVIDERS: Array<any|Type|{[k: string]: any}|any[]> = [
/*@ts2dart_const*/[ {provide: Reflector, useValue: reflector},
{provide: Reflector, useValue: reflector}, {provide: ReflectorReader, useExisting: Reflector},
{provide: ReflectorReader, useExisting: Reflector}, {provide: XHR, useValue: _NO_XHR},
{provide: XHR, useValue: _NO_XHR}, Console,
Console, Lexer,
Lexer, Parser,
Parser, HtmlParser,
HtmlParser, TemplateParser,
TemplateParser, DirectiveNormalizer,
DirectiveNormalizer, CompileMetadataResolver,
CompileMetadataResolver, DEFAULT_PACKAGE_URL_PROVIDER,
DEFAULT_PACKAGE_URL_PROVIDER, StyleCompiler,
StyleCompiler, ViewCompiler,
ViewCompiler, NgModuleCompiler,
NgModuleCompiler, {provide: CompilerConfig, useValue: new CompilerConfig()},
/*@ts2dart_Provider*/ {provide: CompilerConfig, useValue: new CompilerConfig()}, RuntimeCompiler,
RuntimeCompiler, {provide: Compiler, useExisting: RuntimeCompiler},
/*@ts2dart_Provider*/ {provide: Compiler, useExisting: RuntimeCompiler}, DomElementSchemaRegistry,
DomElementSchemaRegistry, {provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry},
/*@ts2dart_Provider*/ {provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry}, UrlResolver,
UrlResolver, DirectiveResolver,
DirectiveResolver, PipeResolver,
PipeResolver, NgModuleResolver
NgModuleResolver ];
];
export function analyzeAppProvidersForDeprecatedConfiguration(appProviders: any[] = []): export function analyzeAppProvidersForDeprecatedConfiguration(appProviders: any[] = []):

View File

@ -567,7 +567,7 @@ export class ClassStmt extends Statement {
export class IfStmt extends Statement { export class IfStmt extends Statement {
constructor( constructor(
public condition: Expression, public trueCase: Statement[], public condition: Expression, public trueCase: Statement[],
public falseCase: Statement[] = /*@ts2dart_const*/[]) { public falseCase: Statement[] = []) {
super(); super();
} }
visitStatement(visitor: StatementVisitor, context: any): any { visitStatement(visitor: StatementVisitor, context: any): any {

View File

@ -75,154 +75,153 @@ const OBJECT = 'object';
// //
// ================================================================================================= // =================================================================================================
const SCHEMA: string[] = const SCHEMA: string[] = ([
/*@ts2dart_const*/ ([ '*|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop',
'*|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop', '^*|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*autocomplete,*autocompleteerror,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate',
'^*|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*autocomplete,*autocompleteerror,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate', 'media|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,#volume',
'media|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,#volume', ':svg:^*|*abort,*autocomplete,*autocompleteerror,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',
':svg:^*|*abort,*autocomplete,*autocompleteerror,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex', ':svg:graphics^:svg:|',
':svg:graphics^:svg:|', ':svg:animation^:svg:|*begin,*end,*repeat',
':svg:animation^:svg:|*begin,*end,*repeat', ':svg:geometry^:svg:|',
':svg:geometry^:svg:|', ':svg:componentTransferFunction^:svg:|',
':svg:componentTransferFunction^:svg:|', ':svg:gradient^:svg:|',
':svg:gradient^:svg:|', ':svg:textContent^:svg:graphics|',
':svg:textContent^:svg:graphics|', ':svg:textPositioning^:svg:textContent|',
':svg:textPositioning^:svg:textContent|', 'a|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerpolicy,rel,rev,search,shape,target,text,type,username',
'a|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerpolicy,rel,rev,search,shape,target,text,type,username', 'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerpolicy,search,shape,target,username',
'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerpolicy,search,shape,target,username', 'audio^media|',
'audio^media|', 'br|clear',
'br|clear', 'base|href,target',
'base|href,target', 'body|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',
'body|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink', 'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value', 'canvas|#height,#width',
'canvas|#height,#width', 'content|select',
'content|select', 'dl|!compact',
'dl|!compact', 'datalist|',
'datalist|', 'details|!open',
'details|!open', 'dialog|!open,returnValue',
'dialog|!open,returnValue', 'dir|!compact',
'dir|!compact', 'div|align',
'div|align', 'embed|align,height,name,src,type,width',
'embed|align,height,name,src,type,width', 'fieldset|!disabled,name',
'fieldset|!disabled,name', 'font|color,face,size',
'font|color,face,size', 'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target', 'frame|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',
'frame|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src', 'frameset|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',
'frameset|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows', 'hr|align,color,!noShade,size,width',
'hr|align,color,!noShade,size,width', 'head|',
'head|', 'h1,h2,h3,h4,h5,h6|align',
'h1,h2,h3,h4,h5,h6|align', 'html|version',
'html|version', 'iframe|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerpolicy,%sandbox,scrolling,src,srcdoc,width',
'iframe|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerpolicy,%sandbox,scrolling,src,srcdoc,width', 'img|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerpolicy,sizes,src,srcset,useMap,#vspace,#width',
'img|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerpolicy,sizes,src,srcset,useMap,#vspace,#width', 'input|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',
'input|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width', 'keygen|!autofocus,challenge,!disabled,keytype,name',
'keygen|!autofocus,challenge,!disabled,keytype,name', 'li|type,#value',
'li|type,#value', 'label|htmlFor',
'label|htmlFor', 'legend|align',
'legend|align', 'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',
'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type', 'map|name',
'map|name', 'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width', 'menu|!compact',
'menu|!compact', 'meta|content,httpEquiv,name,scheme',
'meta|content,httpEquiv,name,scheme', 'meter|#high,#low,#max,#min,#optimum,#value',
'meter|#high,#low,#max,#min,#optimum,#value', 'ins,del|cite,dateTime',
'ins,del|cite,dateTime', 'ol|!compact,!reversed,#start,type',
'ol|!compact,!reversed,#start,type', 'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width', 'optgroup|!disabled,label',
'optgroup|!disabled,label', 'option|!defaultSelected,!disabled,label,!selected,text,value',
'option|!defaultSelected,!disabled,label,!selected,text,value', 'output|defaultValue,%htmlFor,name,value',
'output|defaultValue,%htmlFor,name,value', 'p|align',
'p|align', 'param|name,type,value,valueType',
'param|name,type,value,valueType', 'picture|',
'picture|', 'pre|#width',
'pre|#width', 'progress|#max,#value',
'progress|#max,#value', 'q,blockquote,cite|',
'q,blockquote,cite|', 'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type', 'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value', 'shadow|',
'shadow|', 'source|media,sizes,src,srcset,type',
'source|media,sizes,src,srcset,type', 'span|',
'span|', 'style|!disabled,media,type',
'style|!disabled,media,type', 'caption|align',
'caption|align', 'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width', 'col,colgroup|align,ch,chOff,#span,vAlign,width',
'col,colgroup|align,ch,chOff,#span,vAlign,width', 'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width', 'tr|align,bgColor,ch,chOff,vAlign',
'tr|align,bgColor,ch,chOff,vAlign', 'tfoot,thead,tbody|align,ch,chOff,vAlign',
'tfoot,thead,tbody|align,ch,chOff,vAlign', 'template|',
'template|', 'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap', 'title|text',
'title|text', 'track|!default,kind,label,src,srclang',
'track|!default,kind,label,src,srclang', 'ul|!compact,type',
'ul|!compact,type', 'unknown|',
'unknown|', 'video^media|#height,poster,#width',
'video^media|#height,poster,#width', ':svg:a^:svg:graphics|',
':svg:a^:svg:graphics|', ':svg:animate^:svg:animation|',
':svg:animate^:svg:animation|', ':svg:animateMotion^:svg:animation|',
':svg:animateMotion^:svg:animation|', ':svg:animateTransform^:svg:animation|',
':svg:animateTransform^:svg:animation|', ':svg:circle^:svg:geometry|',
':svg:circle^:svg:geometry|', ':svg:clipPath^:svg:graphics|',
':svg:clipPath^:svg:graphics|', ':svg:cursor^:svg:|',
':svg:cursor^:svg:|', ':svg:defs^:svg:graphics|',
':svg:defs^:svg:graphics|', ':svg:desc^:svg:|',
':svg:desc^:svg:|', ':svg:discard^:svg:|',
':svg:discard^:svg:|', ':svg:ellipse^:svg:geometry|',
':svg:ellipse^:svg:geometry|', ':svg:feBlend^:svg:|',
':svg:feBlend^:svg:|', ':svg:feColorMatrix^:svg:|',
':svg:feColorMatrix^:svg:|', ':svg:feComponentTransfer^:svg:|',
':svg:feComponentTransfer^:svg:|', ':svg:feComposite^:svg:|',
':svg:feComposite^:svg:|', ':svg:feConvolveMatrix^:svg:|',
':svg:feConvolveMatrix^:svg:|', ':svg:feDiffuseLighting^:svg:|',
':svg:feDiffuseLighting^:svg:|', ':svg:feDisplacementMap^:svg:|',
':svg:feDisplacementMap^:svg:|', ':svg:feDistantLight^:svg:|',
':svg:feDistantLight^:svg:|', ':svg:feDropShadow^:svg:|',
':svg:feDropShadow^:svg:|', ':svg:feFlood^:svg:|',
':svg:feFlood^:svg:|', ':svg:feFuncA^:svg:componentTransferFunction|',
':svg:feFuncA^:svg:componentTransferFunction|', ':svg:feFuncB^:svg:componentTransferFunction|',
':svg:feFuncB^:svg:componentTransferFunction|', ':svg:feFuncG^:svg:componentTransferFunction|',
':svg:feFuncG^:svg:componentTransferFunction|', ':svg:feFuncR^:svg:componentTransferFunction|',
':svg:feFuncR^:svg:componentTransferFunction|', ':svg:feGaussianBlur^:svg:|',
':svg:feGaussianBlur^:svg:|', ':svg:feImage^:svg:|',
':svg:feImage^:svg:|', ':svg:feMerge^:svg:|',
':svg:feMerge^:svg:|', ':svg:feMergeNode^:svg:|',
':svg:feMergeNode^:svg:|', ':svg:feMorphology^:svg:|',
':svg:feMorphology^:svg:|', ':svg:feOffset^:svg:|',
':svg:feOffset^:svg:|', ':svg:fePointLight^:svg:|',
':svg:fePointLight^:svg:|', ':svg:feSpecularLighting^:svg:|',
':svg:feSpecularLighting^:svg:|', ':svg:feSpotLight^:svg:|',
':svg:feSpotLight^:svg:|', ':svg:feTile^:svg:|',
':svg:feTile^:svg:|', ':svg:feTurbulence^:svg:|',
':svg:feTurbulence^:svg:|', ':svg:filter^:svg:|',
':svg:filter^:svg:|', ':svg:foreignObject^:svg:graphics|',
':svg:foreignObject^:svg:graphics|', ':svg:g^:svg:graphics|',
':svg:g^:svg:graphics|', ':svg:image^:svg:graphics|',
':svg:image^:svg:graphics|', ':svg:line^:svg:geometry|',
':svg:line^:svg:geometry|', ':svg:linearGradient^:svg:gradient|',
':svg:linearGradient^:svg:gradient|', ':svg:mpath^:svg:|',
':svg:mpath^:svg:|', ':svg:marker^:svg:|',
':svg:marker^:svg:|', ':svg:mask^:svg:|',
':svg:mask^:svg:|', ':svg:metadata^:svg:|',
':svg:metadata^:svg:|', ':svg:path^:svg:geometry|',
':svg:path^:svg:geometry|', ':svg:pattern^:svg:|',
':svg:pattern^:svg:|', ':svg:polygon^:svg:geometry|',
':svg:polygon^:svg:geometry|', ':svg:polyline^:svg:geometry|',
':svg:polyline^:svg:geometry|', ':svg:radialGradient^:svg:gradient|',
':svg:radialGradient^:svg:gradient|', ':svg:rect^:svg:geometry|',
':svg:rect^:svg:geometry|', ':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',
':svg:svg^:svg:graphics|#currentScale,#zoomAndPan', ':svg:script^:svg:|type',
':svg:script^:svg:|type', ':svg:set^:svg:animation|',
':svg:set^:svg:animation|', ':svg:stop^:svg:|',
':svg:stop^:svg:|', ':svg:style^:svg:|!disabled,media,title,type',
':svg:style^:svg:|!disabled,media,title,type', ':svg:switch^:svg:graphics|',
':svg:switch^:svg:graphics|', ':svg:symbol^:svg:|',
':svg:symbol^:svg:|', ':svg:tspan^:svg:textPositioning|',
':svg:tspan^:svg:textPositioning|', ':svg:text^:svg:textPositioning|',
':svg:text^:svg:textPositioning|', ':svg:textPath^:svg:textContent|',
':svg:textPath^:svg:textContent|', ':svg:title^:svg:|',
':svg:title^:svg:|', ':svg:use^:svg:graphics|',
':svg:use^:svg:graphics|', ':svg:view^:svg:|#zoomAndPan',
':svg:view^:svg:|#zoomAndPan', ]);
]);
var attrToPropMap: {[name: string]: string} = <any>{ var attrToPropMap: {[name: string]: string} = <any>{
'class': 'className', 'class': 'className',

View File

@ -10,7 +10,7 @@ import {ListWrapper} from './facade/collection';
import {BaseException} from './facade/exceptions'; import {BaseException} from './facade/exceptions';
import {RegExpMatcherWrapper, RegExpWrapper, StringWrapper, isBlank, isPresent} from './facade/lang'; import {RegExpMatcherWrapper, RegExpWrapper, StringWrapper, isBlank, isPresent} from './facade/lang';
const _EMPTY_ATTR_VALUE = /*@ts2dart_const*/ ''; const _EMPTY_ATTR_VALUE = '';
// TODO: Can't use `const` here as // TODO: Can't use `const` here as
// in Dart this is not transpiled into `final` yet... // in Dart this is not transpiled into `final` yet...

View File

@ -63,7 +63,7 @@ const TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];
* *
* This is currently an internal-only feature and not meant for general use. * This is currently an internal-only feature and not meant for general use.
*/ */
export const TEMPLATE_TRANSFORMS: any = /*@ts2dart_const*/ new OpaqueToken('TemplateTransforms'); export const TEMPLATE_TRANSFORMS: any = new OpaqueToken('TemplateTransforms');
export class TemplateParseError extends ParseError { export class TemplateParseError extends ParseError {
constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel) { constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel) {

View File

@ -163,7 +163,7 @@ class ListDir1Alt {
class ListDir2 { class ListDir2 {
} }
const LIST_CHILDREN = /*@ts2dart_const*/[ListDir1, ListDir2]; const LIST_CHILDREN = [ListDir1, ListDir2];
@Component({ @Component({
selector: 'directive-list-comp', selector: 'directive-list-comp',

View File

@ -21,7 +21,7 @@ import {OpaqueToken} from './di';
* using this token. * using this token.
* @experimental * @experimental
*/ */
export const APP_ID: any = /*@ts2dart_const*/ new OpaqueToken('AppId'); export const APP_ID: any = new OpaqueToken('AppId');
export function _appIdRandomProviderFactory() { export function _appIdRandomProviderFactory() {
return `${_randomChar()}${_randomChar()}${_randomChar()}`; return `${_randomChar()}${_randomChar()}${_randomChar()}`;
@ -31,12 +31,11 @@ export function _appIdRandomProviderFactory() {
* Providers that will generate a random APP_ID_TOKEN. * Providers that will generate a random APP_ID_TOKEN.
* @experimental * @experimental
*/ */
export const APP_ID_RANDOM_PROVIDER = export const APP_ID_RANDOM_PROVIDER = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: APP_ID,
provide: APP_ID, useFactory: _appIdRandomProviderFactory,
useFactory: _appIdRandomProviderFactory, deps: <any[]>[]
deps: <any[]>[] };
};
function _randomChar(): string { function _randomChar(): string {
return StringWrapper.fromCharCode(97 + Math.floor(Math.random() * 25)); return StringWrapper.fromCharCode(97 + Math.floor(Math.random() * 25));
@ -46,19 +45,16 @@ function _randomChar(): string {
* A function that will be executed when a platform is initialized. * A function that will be executed when a platform is initialized.
* @experimental * @experimental
*/ */
export const PLATFORM_INITIALIZER: any = export const PLATFORM_INITIALIZER: any = new OpaqueToken('Platform Initializer');
/*@ts2dart_const*/ new OpaqueToken('Platform Initializer');
/** /**
* A function that will be executed when an application is initialized. * A function that will be executed when an application is initialized.
* @experimental * @experimental
*/ */
export const APP_INITIALIZER: any = export const APP_INITIALIZER: any = new OpaqueToken('Application Initializer');
/*@ts2dart_const*/ new OpaqueToken('Application Initializer');
/** /**
* A token which indicates the root directory of the application * A token which indicates the root directory of the application
* @experimental * @experimental
*/ */
export const PACKAGE_ROOT_URL: any = export const PACKAGE_ROOT_URL: any = new OpaqueToken('Application Packages Root URL');
/*@ts2dart_const*/ new OpaqueToken('Application Packages Root URL');

View File

@ -27,15 +27,13 @@ export {PipeTransform} from './pipe_transform';
/** /**
* Structural diffing for `Object`s and `Map`s. * Structural diffing for `Object`s and `Map`s.
*/ */
export const keyValDiff: KeyValueDifferFactory[] = export const keyValDiff: KeyValueDifferFactory[] = [new DefaultKeyValueDifferFactory()];
/*@ts2dart_const*/[new DefaultKeyValueDifferFactory()];
/** /**
* Structural diffing for `Iterable` types such as `Array`s. * Structural diffing for `Iterable` types such as `Array`s.
*/ */
export const iterableDiff: IterableDifferFactory[] = export const iterableDiff: IterableDifferFactory[] = [new DefaultIterableDifferFactory()];
/*@ts2dart_const*/[new DefaultIterableDifferFactory()];
export const defaultIterableDiffers = /*@ts2dart_const*/ new IterableDiffers(iterableDiff); export const defaultIterableDiffers = new IterableDiffers(iterableDiff);
export const defaultKeyValueDiffers = /*@ts2dart_const*/ new KeyValueDiffers(keyValDiff); export const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);

View File

@ -14,7 +14,6 @@ import {ChangeDetectorRef} from '../change_detector_ref';
import {IterableDiffer, IterableDifferFactory, TrackByFn} from './iterable_differs'; import {IterableDiffer, IterableDifferFactory, TrackByFn} from './iterable_differs';
/* @ts2dart_const */
export class DefaultIterableDifferFactory implements IterableDifferFactory { export class DefaultIterableDifferFactory implements IterableDifferFactory {
constructor() {} constructor() {}
supports(obj: Object): boolean { return isListLikeIterable(obj); } supports(obj: Object): boolean { return isListLikeIterable(obj); }

View File

@ -45,11 +45,9 @@ export interface IterableDifferFactory {
/** /**
* A repository of different iterable diffing strategies used by NgFor, NgClass, and others. * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
* @ts2dart_const
* @stable * @stable
*/ */
export class IterableDiffers { export class IterableDiffers {
/*@ts2dart_const*/
constructor(public factories: IterableDifferFactory[]) {} constructor(public factories: IterableDifferFactory[]) {}
static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers { static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers {

View File

@ -35,11 +35,9 @@ export interface KeyValueDifferFactory {
/** /**
* A repository of different Map diffing strategies used by NgClass, NgStyle, and others. * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
* @ts2dart_const
* @stable * @stable
*/ */
export class KeyValueDiffers { export class KeyValueDiffers {
/*@ts2dart_const*/
constructor(public factories: KeyValueDifferFactory[]) {} constructor(public factories: KeyValueDifferFactory[]) {}
static create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers { static create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers {

View File

@ -9,8 +9,8 @@
import {BaseException, unimplemented} from '../facade/exceptions'; import {BaseException, unimplemented} from '../facade/exceptions';
import {stringify} from '../facade/lang'; import {stringify} from '../facade/lang';
const _THROW_IF_NOT_FOUND = /*@ts2dart_const*/ new Object(); const _THROW_IF_NOT_FOUND = new Object();
export const THROW_IF_NOT_FOUND = /*@ts2dart_const*/ _THROW_IF_NOT_FOUND; export const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
class _NullInjector implements Injector { class _NullInjector implements Injector {
get(token: any, notFoundValue: any = _THROW_IF_NOT_FOUND): any { get(token: any, notFoundValue: any = _THROW_IF_NOT_FOUND): any {

View File

@ -47,7 +47,6 @@ import {stringify} from '../facade/lang';
* var injector = Injector.resolveAndCreate([Engine, Car]); * var injector = Injector.resolveAndCreate([Engine, Car]);
* expect(injector.get(Car).engine instanceof Engine).toBe(true); * expect(injector.get(Car).engine instanceof Engine).toBe(true);
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class InjectMetadata { export class InjectMetadata {
@ -75,7 +74,6 @@ export class InjectMetadata {
* var injector = Injector.resolveAndCreate([Car]); * var injector = Injector.resolveAndCreate([Car]);
* expect(injector.get(Car).engine).toBeNull(); * expect(injector.get(Car).engine).toBeNull();
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class OptionalMetadata { export class OptionalMetadata {
@ -85,7 +83,6 @@ export class OptionalMetadata {
/** /**
* `DependencyMetadata` is used by the framework to extend DI. * `DependencyMetadata` is used by the framework to extend DI.
* This is internal to Angular and should not be used directly. * This is internal to Angular and should not be used directly.
* @ts2dart_const
* @stable * @stable
*/ */
export class DependencyMetadata { export class DependencyMetadata {
@ -122,7 +119,6 @@ export class DependencyMetadata {
* var injector = Injector.resolveAndCreate([NeedsService, UsefulService]); * var injector = Injector.resolveAndCreate([NeedsService, UsefulService]);
* expect(() => injector.get(NeedsService)).toThrowError(); * expect(() => injector.get(NeedsService)).toThrowError();
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class InjectableMetadata { export class InjectableMetadata {
@ -155,7 +151,6 @@ export class InjectableMetadata {
* var child = inj.resolveAndCreateChild([NeedsDependency]); * var child = inj.resolveAndCreateChild([NeedsDependency]);
* expect(() => child.get(NeedsDependency)).toThrowError(); * expect(() => child.get(NeedsDependency)).toThrowError();
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class SelfMetadata { export class SelfMetadata {
@ -186,7 +181,6 @@ export class SelfMetadata {
* var inj = Injector.resolveAndCreate([Dependency, NeedsDependency]); * var inj = Injector.resolveAndCreate([Dependency, NeedsDependency]);
* expect(() => inj.get(NeedsDependency)).toThrowError(); * expect(() => inj.get(NeedsDependency)).toThrowError();
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class SkipSelfMetadata { export class SkipSelfMetadata {
@ -246,7 +240,6 @@ export class SkipSelfMetadata {
* *
* bootstrap(App); * bootstrap(App);
*``` *```
* @ts2dart_const
* @stable * @stable
*/ */
export class HostMetadata { export class HostMetadata {

View File

@ -26,7 +26,6 @@
* *
* Using an `OpaqueToken` is preferable to using an `Object` as tokens because it provides better * Using an `OpaqueToken` is preferable to using an `Object` as tokens because it provides better
* error messages. * error messages.
* @ts2dart_const
* @stable * @stable
*/ */
export class OpaqueToken { export class OpaqueToken {

View File

@ -24,7 +24,6 @@ import {Type, isBlank, isFunction, isType, normalizeBool, stringify} from '../fa
* *
* expect(injector.get("message")).toEqual('Hello'); * expect(injector.get("message")).toEqual('Hello');
* ``` * ```
* @ts2dart_const
* @deprecated * @deprecated
*/ */
export class Provider { export class Provider {
@ -211,7 +210,6 @@ export class Provider {
* See {@link Provider} instead. * See {@link Provider} instead.
* *
* @deprecated * @deprecated
* @ts2dart_const
*/ */
export class Binding extends Provider { export class Binding extends Provider {
constructor(token: any, {toClass, toValue, toAlias, toFactory, deps, multi}: { constructor(token: any, {toClass, toValue, toAlias, toFactory, deps, multi}: {

View File

@ -21,7 +21,7 @@ var __unused: Type; // avoid unused import when Type union types are erased
// Threshold for the dynamic version // Threshold for the dynamic version
const _MAX_CONSTRUCTION_COUNTER = 10; const _MAX_CONSTRUCTION_COUNTER = 10;
const UNDEFINED = /*@ts2dart_const*/ new Object(); const UNDEFINED = new Object();
export interface ReflectiveProtoInjectorStrategy { export interface ReflectiveProtoInjectorStrategy {
getProviderAtIndex(index: number): ResolvedReflectiveProvider; getProviderAtIndex(index: number): ResolvedReflectiveProvider;
@ -629,7 +629,7 @@ export class ReflectiveInjector_ implements ReflectiveInjector {
*/ */
debugContext(): any { return this._debugContext(); } debugContext(): any { return this._debugContext(); }
get(token: any, notFoundValue: any = /*@ts2dart_const*/ THROW_IF_NOT_FOUND): any { get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {
return this._getByKey(ReflectiveKey.get(token), null, null, notFoundValue); return this._getByKey(ReflectiveKey.get(token), null, null, notFoundValue);
} }

View File

@ -30,7 +30,7 @@ export class ReflectiveDependency {
} }
} }
const _EMPTY_LIST: any[] = /*@ts2dart_const*/[]; const _EMPTY_LIST: any[] = [];
/** /**
* An internal resolved representation of a {@link Provider} used by the {@link Injector}. * An internal resolved representation of a {@link Provider} used by the {@link Injector}.

View File

@ -81,7 +81,6 @@ export class ComponentRef_<C> extends ComponentRef<C> {
/** /**
* @experimental * @experimental
* @ts2dart_const
*/ */
const EMPTY_CONTEXT = new Object(); const EMPTY_CONTEXT = new Object();

View File

@ -15,7 +15,6 @@ import {DebugAppView} from './view';
import {ViewType} from './view_type'; import {ViewType} from './view_type';
/* @ts2dart_const */
export class StaticNodeDebugInfo { export class StaticNodeDebugInfo {
constructor( constructor(
public providerTokens: any[], public componentToken: any, public providerTokens: any[], public componentToken: any,

View File

@ -9,7 +9,7 @@
import {Injector, THROW_IF_NOT_FOUND} from '../di/injector'; import {Injector, THROW_IF_NOT_FOUND} from '../di/injector';
import {AppView} from './view'; import {AppView} from './view';
const _UNDEFINED = /*@ts2dart_const*/ new Object(); const _UNDEFINED = new Object();
export class ElementInjector extends Injector { export class ElementInjector extends Injector {
constructor(private _view: AppView<any>, private _nodeIndex: number) { super(); } constructor(private _view: AppView<any>, private _nodeIndex: number) { super(); }

View File

@ -12,7 +12,7 @@ import {ElementRef} from './element_ref';
import {AppView} from './view'; import {AppView} from './view';
import {EmbeddedViewRef} from './view_ref'; import {EmbeddedViewRef} from './view_ref';
const EMPTY_CONTEXT = /*@ts2dart_const*/ new Object(); const EMPTY_CONTEXT = new Object();
/** /**
* Represents an Embedded Template that can be used to instantiate Embedded Views. * Represents an Embedded Template that can be used to instantiate Embedded Views.

View File

@ -70,7 +70,7 @@ function _flattenNestedViewRenderNodes(nodes: any[], renderNodes: any[]): any[]
return renderNodes; return renderNodes;
} }
const EMPTY_ARR: any[] = /*@ts2dart_const*/[]; const EMPTY_ARR: any[] = [];
export function ensureSlotCount(projectableNodes: any[][], expectedSlotCount: number): any[][] { export function ensureSlotCount(projectableNodes: any[][], expectedSlotCount: number): any[][] {
var res: any[][]; var res: any[][];

View File

@ -63,7 +63,6 @@ export const ANALYZE_FOR_ENTRY_COMPONENTS = new OpaqueToken('AnalyzeForEntryComp
* A decorator can inject string literal `text` like so: * A decorator can inject string literal `text` like so:
* *
* {@example core/ts/metadata/metadata.ts region='attributeMetadata'} * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
* @ts2dart_const
* @stable * @stable
*/ */
export class AttributeMetadata extends DependencyMetadata { export class AttributeMetadata extends DependencyMetadata {
@ -186,7 +185,6 @@ export class AttributeMetadata extends DependencyMetadata {
* *
* The injected object is an unmodifiable live list. * The injected object is an unmodifiable live list.
* See {@link QueryList} for more details. * See {@link QueryList} for more details.
* @ts2dart_const
* @deprecated * @deprecated
*/ */
export class QueryMetadata extends DependencyMetadata { export class QueryMetadata extends DependencyMetadata {
@ -256,7 +254,6 @@ export class QueryMetadata extends DependencyMetadata {
* } * }
* } * }
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class ContentChildrenMetadata extends QueryMetadata { export class ContentChildrenMetadata extends QueryMetadata {
@ -287,7 +284,6 @@ export class ContentChildrenMetadata extends QueryMetadata {
* } * }
* } * }
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class ContentChildMetadata extends QueryMetadata { export class ContentChildMetadata extends QueryMetadata {
@ -330,7 +326,6 @@ export class ContentChildMetadata extends QueryMetadata {
* *
* The injected object is an iterable and observable live list. * The injected object is an iterable and observable live list.
* See {@link QueryList} for more details. * See {@link QueryList} for more details.
* @ts2dart_const
* @deprecated * @deprecated
*/ */
export class ViewQueryMetadata extends QueryMetadata { export class ViewQueryMetadata extends QueryMetadata {
@ -423,7 +418,6 @@ export class ViewQueryMetadata extends QueryMetadata {
* } * }
* } * }
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class ViewChildrenMetadata extends ViewQueryMetadata { export class ViewChildrenMetadata extends ViewQueryMetadata {
@ -501,7 +495,6 @@ export class ViewChildrenMetadata extends ViewQueryMetadata {
* } * }
* } * }
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class ViewChildMetadata extends ViewQueryMetadata { export class ViewChildMetadata extends ViewQueryMetadata {

View File

@ -408,7 +408,6 @@ export interface DirectiveMetadataType {
* Note also that although the `<li></li>` template still exists inside the `<template></template>`, * Note also that although the `<li></li>` template still exists inside the `<template></template>`,
* the instantiated * the instantiated
* view occurs on the second `<li></li>` which is a sibling to the `<template>` element. * view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
* @ts2dart_const
* @stable * @stable
*/ */
export class DirectiveMetadata extends InjectableMetadata implements DirectiveMetadataType { export class DirectiveMetadata extends InjectableMetadata implements DirectiveMetadataType {
@ -824,7 +823,6 @@ export interface ComponentMetadataType extends DirectiveMetadataType {
* ### Example * ### Example
* *
* {@example core/ts/metadata/metadata.ts region='component'} * {@example core/ts/metadata/metadata.ts region='component'}
* @ts2dart_const
* @stable * @stable
*/ */
export class ComponentMetadata extends DirectiveMetadata implements ComponentMetadataType { export class ComponentMetadata extends DirectiveMetadata implements ComponentMetadataType {
@ -1095,7 +1093,6 @@ export interface PipeMetadataType {
* ### Example * ### Example
* *
* {@example core/ts/metadata/metadata.ts region='pipe'} * {@example core/ts/metadata/metadata.ts region='pipe'}
* @ts2dart_const
* @stable * @stable
*/ */
export class PipeMetadata extends InjectableMetadata implements PipeMetadataType { export class PipeMetadata extends InjectableMetadata implements PipeMetadataType {
@ -1152,7 +1149,6 @@ export class PipeMetadata extends InjectableMetadata implements PipeMetadataType
* *
* bootstrap(App); * bootstrap(App);
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class InputMetadata { export class InputMetadata {
@ -1203,7 +1199,6 @@ export class InputMetadata {
* } * }
* bootstrap(App); * bootstrap(App);
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class OutputMetadata { export class OutputMetadata {
@ -1244,7 +1239,6 @@ export class OutputMetadata {
* *
* bootstrap(App); * bootstrap(App);
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class HostBindingMetadata { export class HostBindingMetadata {
@ -1284,7 +1278,6 @@ export class HostBindingMetadata {
* *
* bootstrap(App); * bootstrap(App);
* ``` * ```
* @ts2dart_const
* @stable * @stable
*/ */
export class HostListenerMetadata { export class HostListenerMetadata {

View File

@ -71,7 +71,6 @@ export var VIEW_ENCAPSULATION_VALUES =
* } * }
* } * }
* ``` * ```
* @ts2dart_const
* *
* @deprecated Use ComponentMetadata instead. * @deprecated Use ComponentMetadata instead.
*/ */

View File

@ -36,8 +36,7 @@ import {OpaqueToken} from './di';
* @deprecated Providing platform directives via a provider is deprecated. Provide platform * @deprecated Providing platform directives via a provider is deprecated. Provide platform
* directives via an {@link NgModule} instead. * directives via an {@link NgModule} instead.
*/ */
export const PLATFORM_DIRECTIVES: OpaqueToken = export const PLATFORM_DIRECTIVES: OpaqueToken = new OpaqueToken('Platform Directives');
/*@ts2dart_const*/ new OpaqueToken('Platform Directives');
/** /**
* A token that can be provided when bootstraping an application to make an array of pipes * A token that can be provided when bootstraping an application to make an array of pipes
@ -65,4 +64,4 @@ export const PLATFORM_DIRECTIVES: OpaqueToken =
* @deprecated Providing platform pipes via a provider is deprecated. Provide platform pipes via an * @deprecated Providing platform pipes via a provider is deprecated. Provide platform pipes via an
* {@link NgModule} instead. * {@link NgModule} instead.
*/ */
export const PLATFORM_PIPES: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Platform Pipes'); export const PLATFORM_PIPES: OpaqueToken = new OpaqueToken('Platform Pipes');

View File

@ -11,12 +11,10 @@ import {WtfScopeFn, createScope, detectWTF, endTimeRange, leave, startTimeRange}
export {WtfScopeFn} from './wtf_impl'; export {WtfScopeFn} from './wtf_impl';
// Change exports to const once https://github.com/angular/ts2dart/issues/150
/** /**
* True if WTF is enabled. * True if WTF is enabled.
*/ */
export var wtfEnabled = detectWTF(); export const wtfEnabled = detectWTF();
function noopScope(arg0?: any, arg1?: any): any { function noopScope(arg0?: any, arg1?: any): any {
return null; return null;

View File

@ -148,7 +148,6 @@ export interface GetTestability {
Testability; Testability;
} }
/* @ts2dart_const */
class _NoopGetTestability implements GetTestability { class _NoopGetTestability implements GetTestability {
addToWindow(registry: TestabilityRegistry): void {} addToWindow(registry: TestabilityRegistry): void {}
findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):
@ -165,4 +164,4 @@ export function setTestabilityGetter(getter: GetTestability): void {
_testabilityGetter = getter; _testabilityGetter = getter;
} }
var _testabilityGetter: GetTestability = /*@ts2dart_const*/ new _NoopGetTestability(); var _testabilityGetter: GetTestability = new _NoopGetTestability();

View File

@ -9,10 +9,8 @@
import {isBlank} from '../../src/facade/lang'; import {isBlank} from '../../src/facade/lang';
export function iterableChangesAsString( export function iterableChangesAsString(
{collection = /*@ts2dart_const*/[] as any, previous = /*@ts2dart_const*/[] as any, {collection = [] as any, previous = [] as any, additions = [] as any, moves = [] as any,
additions = /*@ts2dart_const*/[] as any, moves = /*@ts2dart_const*/[] as any, removals = [] as any, identityChanges = [] as any}): string {
removals = /*@ts2dart_const*/[] as any,
identityChanges = /*@ts2dart_const*/[] as any}): string {
return 'collection: ' + collection.join(', ') + '\n' + return 'collection: ' + collection.join(', ') + '\n' +
'previous: ' + previous.join(', ') + '\n' + 'previous: ' + previous.join(', ') + '\n' +
'additions: ' + additions.join(', ') + '\n' + 'additions: ' + additions.join(', ') + '\n' +

View File

@ -1129,7 +1129,7 @@ export function main() {
}); });
} }
const ALL_DIRECTIVES = /*@ts2dart_const*/[ const ALL_DIRECTIVES = [
forwardRef(() => TestDirective), forwardRef(() => TestDirective),
forwardRef(() => TestComponent), forwardRef(() => TestComponent),
forwardRef(() => AnotherComponent), forwardRef(() => AnotherComponent),
@ -1144,7 +1144,7 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/[
NgFor, NgFor,
]; ];
const ALL_PIPES = /*@ts2dart_const*/[ const ALL_PIPES = [
forwardRef(() => CountingPipe), forwardRef(() => CountingPipe),
forwardRef(() => CountingImpurePipe), forwardRef(() => CountingImpurePipe),
forwardRef(() => MultiArgPipe), forwardRef(() => MultiArgPipe),

View File

@ -36,7 +36,7 @@ import {TemplateRef, TemplateRef_} from '@angular/core/src/linker/template_ref';
import {Renderer} from '@angular/core/src/render'; import {Renderer} from '@angular/core/src/render';
import {el, dispatchEvent} from '@angular/platform-browser/testing/browser_util'; import {el, dispatchEvent} from '@angular/platform-browser/testing/browser_util';
const ANCHOR_ELEMENT = /*@ts2dart_const*/ new OpaqueToken('AnchorElement'); const ANCHOR_ELEMENT = new OpaqueToken('AnchorElement');
export function main() { export function main() {
describe('jit', () => { declareTests({useJit: true}); }); describe('jit', () => { declareTests({useJit: true}); });
@ -2416,9 +2416,7 @@ class PublicApi {
@Directive({ @Directive({
selector: '[public-api]', selector: '[public-api]',
providers: [ providers: [{provide: PublicApi, useExisting: PrivateImpl, deps: []}]
/* @ts2dart_Provider */ {provide: PublicApi, useExisting: PrivateImpl, deps: []}
]
}) })
class PrivateImpl extends PublicApi { class PrivateImpl extends PublicApi {
} }
@ -2482,13 +2480,8 @@ function createInjectableWithLogging(inj: Injector) {
@Component({ @Component({
selector: 'component-providing-logging-injectable', selector: 'component-providing-logging-injectable',
providers: [ providers:
/* @ts2dart_Provider */ { [{provide: InjectableService, useFactory: createInjectableWithLogging, deps: [Injector]}],
provide: InjectableService,
useFactory: createInjectableWithLogging,
deps: [Injector]
}
],
template: '' template: ''
}) })
class ComponentProvidingLoggingInjectable { class ComponentProvidingLoggingInjectable {
@ -2510,8 +2503,8 @@ class DirectiveProvidingInjectableInView {
@Component({ @Component({
selector: 'directive-providing-injectable', selector: 'directive-providing-injectable',
providers: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'host'}], providers: [{provide: InjectableService, useValue: 'host'}],
viewProviders: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'view'}], viewProviders: [{provide: InjectableService, useValue: 'view'}],
template: '' template: ''
}) })
class DirectiveProvidingInjectableInHostAndView { class DirectiveProvidingInjectableInHostAndView {
@ -2545,7 +2538,6 @@ class DirectiveConsumingInjectableUnbounded {
} }
/* @ts2dart_const */
class EventBus { class EventBus {
parentEventBus: EventBus; parentEventBus: EventBus;
name: string; name: string;
@ -2558,9 +2550,7 @@ class EventBus {
@Directive({ @Directive({
selector: 'grand-parent-providing-event-bus', selector: 'grand-parent-providing-event-bus',
providers: [ providers: [{provide: EventBus, useValue: new EventBus(null, 'grandparent')}]
/* @ts2dart_Provider */ {provide: EventBus, useValue: new EventBus(null, 'grandparent')}
]
}) })
class GrandParentProvidingEventBus { class GrandParentProvidingEventBus {
bus: EventBus; bus: EventBus;

View File

@ -14,7 +14,7 @@ import {Type, ViewContainerRef, TemplateRef, ElementRef, ChangeDetectorRef, Chan
import {NgIf, NgFor} from '@angular/common'; import {NgIf, NgFor} from '@angular/common';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
const ALL_DIRECTIVES = /*@ts2dart_const*/[ const ALL_DIRECTIVES = [
forwardRef(() => SimpleDirective), forwardRef(() => SimpleDirective),
forwardRef(() => CycleDirective), forwardRef(() => CycleDirective),
forwardRef(() => SimpleComponent), forwardRef(() => SimpleComponent),
@ -49,7 +49,7 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/[
NgFor NgFor
]; ];
const ALL_PIPES = /*@ts2dart_const*/[ const ALL_PIPES = [
forwardRef(() => PipeNeedsChangeDetectorRef), forwardRef(() => PipeNeedsChangeDetectorRef),
forwardRef(() => PipeNeedsService), forwardRef(() => PipeNeedsService),
forwardRef(() => PurePipe), forwardRef(() => PurePipe),

View File

@ -60,7 +60,7 @@ export function main() {
describe('const', () => { describe('const', () => {
it('should support const expressions both in TS and Dart', () => { it('should support const expressions both in TS and Dart', () => {
const numbers = /*@ts2dart_const*/[1, 2, 3]; const numbers = [1, 2, 3];
expect(numbers).toEqual([1, 2, 3]); expect(numbers).toEqual([1, 2, 3]);
}); });
}); });

View File

@ -44,18 +44,17 @@ export {NgSelectOption, SelectControlValueAccessor} from './directives/select_co
export {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor'; export {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor';
export {MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValidator} from './directives/validators'; export {MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValidator} from './directives/validators';
export const SHARED_FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/[ export const SHARED_FORM_DIRECTIVES: Type[] = [
NgSelectOption, NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, NgSelectOption, NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor,
CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor,
RadioControlValueAccessor, NgControlStatus, RequiredValidator, MinLengthValidator, RadioControlValueAccessor, NgControlStatus, RequiredValidator, MinLengthValidator,
MaxLengthValidator, PatternValidator MaxLengthValidator, PatternValidator
]; ];
export const TEMPLATE_DRIVEN_DIRECTIVES: Type[] = /*@ts2dart_const*/[NgModel, NgModelGroup, NgForm]; export const TEMPLATE_DRIVEN_DIRECTIVES: Type[] = [NgModel, NgModelGroup, NgForm];
export const REACTIVE_DRIVEN_DIRECTIVES: Type[] = /*@ts2dart_const*/[ export const REACTIVE_DRIVEN_DIRECTIVES: Type[] =
FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];
];
/** /**
* *
@ -74,15 +73,14 @@ export const REACTIVE_DRIVEN_DIRECTIVES: Type[] = /*@ts2dart_const*/[
* ``` * ```
* @experimental * @experimental
*/ */
export const FORM_DIRECTIVES: Type[][] = export const FORM_DIRECTIVES: Type[][] = [TEMPLATE_DRIVEN_DIRECTIVES, SHARED_FORM_DIRECTIVES];
/*@ts2dart_const*/[TEMPLATE_DRIVEN_DIRECTIVES, SHARED_FORM_DIRECTIVES];
/** /**
* @experimental * @experimental
*/ */
export const REACTIVE_FORM_DIRECTIVES: Type[][] = export const REACTIVE_FORM_DIRECTIVES: Type[][] =
/*@ts2dart_const*/[REACTIVE_DRIVEN_DIRECTIVES, SHARED_FORM_DIRECTIVES]; [REACTIVE_DRIVEN_DIRECTIVES, SHARED_FORM_DIRECTIVES];
/** /**
* Internal module used for sharing directives between FormsModule and ReactiveFormsModule * Internal module used for sharing directives between FormsModule and ReactiveFormsModule

View File

@ -10,7 +10,7 @@ import {Directive, ElementRef, Renderer, forwardRef} from '@angular/core';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const CHECKBOX_VALUE_ACCESSOR: any = /*@ts2dart_const*/ { export const CHECKBOX_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => CheckboxControlValueAccessor), useExisting: forwardRef(() => CheckboxControlValueAccessor),
multi: true multi: true

View File

@ -41,5 +41,4 @@ export interface ControlValueAccessor {
* See {@link DefaultValueAccessor} for how to implement one. * See {@link DefaultValueAccessor} for how to implement one.
* @experimental * @experimental
*/ */
export const NG_VALUE_ACCESSOR: OpaqueToken = export const NG_VALUE_ACCESSOR: OpaqueToken = new OpaqueToken('NgValueAccessor');
/*@ts2dart_const*/ new OpaqueToken('NgValueAccessor');

View File

@ -12,12 +12,11 @@ import {isBlank} from '../facade/lang';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const DEFAULT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ export const DEFAULT_VALUE_ACCESSOR: any = {
/* @ts2dart_Provider */ { provide: NG_VALUE_ACCESSOR,
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DefaultValueAccessor),
useExisting: forwardRef(() => DefaultValueAccessor), multi: true
multi: true };
};
/** /**
* The default accessor for writing a value and listening to changes that is used by the * The default accessor for writing a value and listening to changes that is used by the

View File

@ -21,8 +21,10 @@ import {NgModel} from './ng_model';
import {NgModelGroup} from './ng_model_group'; import {NgModelGroup} from './ng_model_group';
import {composeAsyncValidators, composeValidators, setUpControl, setUpFormContainer} from './shared'; import {composeAsyncValidators, composeValidators, setUpControl, setUpFormContainer} from './shared';
export const formDirectiveProvider: any = export const formDirectiveProvider: any = {
/*@ts2dart_const*/ {provide: ControlContainer, useExisting: forwardRef(() => NgForm)}; provide: ControlContainer,
useExisting: forwardRef(() => NgForm)
};
/** /**
* If `NgForm` is bound in a component, `<form>` elements in that component will be * If `NgForm` is bound in a component, `<form>` elements in that component will be

View File

@ -23,11 +23,10 @@ import {composeAsyncValidators, composeValidators, controlPath, isPropertyUpdate
import {TemplateDrivenErrors} from './template_driven_errors'; import {TemplateDrivenErrors} from './template_driven_errors';
import {AsyncValidatorFn, ValidatorFn} from './validators'; import {AsyncValidatorFn, ValidatorFn} from './validators';
export const formControlBinding: any = export const formControlBinding: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: NgControl,
provide: NgControl, useExisting: forwardRef(() => NgModel)
useExisting: forwardRef(() => NgModel) };
};
/** /**
* Binds a domain model to a form control. * Binds a domain model to a form control.

View File

@ -16,11 +16,10 @@ import {ControlContainer} from './control_container';
import {NgForm} from './ng_form'; import {NgForm} from './ng_form';
import {TemplateDrivenErrors} from './template_driven_errors'; import {TemplateDrivenErrors} from './template_driven_errors';
export const modelGroupProvider: any = export const modelGroupProvider: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: ControlContainer,
provide: ControlContainer, useExisting: forwardRef(() => NgModelGroup)
useExisting: forwardRef(() => NgModelGroup) };
};
/** /**
* Creates and binds a model group to a DOM element. * Creates and binds a model group to a DOM element.

View File

@ -12,7 +12,7 @@ import {NumberWrapper, isBlank} from '../facade/lang';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const NUMBER_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const NUMBER_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => NumberValueAccessor), useExisting: forwardRef(() => NumberValueAccessor),
multi: true multi: true

View File

@ -15,7 +15,7 @@ import {isPresent} from '../facade/lang';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
import {NgControl} from './ng_control'; import {NgControl} from './ng_control';
export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const RADIO_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => RadioControlValueAccessor), useExisting: forwardRef(() => RadioControlValueAccessor),
multi: true multi: true

View File

@ -19,11 +19,10 @@ import {AsyncValidatorFn, ValidatorFn} from '../validators';
import {FormGroupDirective} from './form_group_directive'; import {FormGroupDirective} from './form_group_directive';
import {FormGroupName} from './form_group_name'; import {FormGroupName} from './form_group_name';
export const formArrayNameProvider: any = export const formArrayNameProvider: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: ControlContainer,
provide: ControlContainer, useExisting: forwardRef(() => FormArrayName)
useExisting: forwardRef(() => FormArrayName) };
};
/** /**
* Syncs an existing form array to a DOM element. * Syncs an existing form array to a DOM element.

View File

@ -18,11 +18,10 @@ import {NgControl} from '../ng_control';
import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from '../shared'; import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from '../shared';
import {AsyncValidatorFn, ValidatorFn} from '../validators'; import {AsyncValidatorFn, ValidatorFn} from '../validators';
export const formControlBinding: any = export const formControlBinding: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: NgControl,
provide: NgControl, useExisting: forwardRef(() => FormControlDirective)
useExisting: forwardRef(() => FormControlDirective) };
};
/** /**
* Binds an existing {@link FormControl} to a DOM element. * Binds an existing {@link FormControl} to a DOM element.

View File

@ -25,11 +25,10 @@ import {FormGroupDirective} from './form_group_directive';
import {FormGroupName} from './form_group_name'; import {FormGroupName} from './form_group_name';
export const controlNameBinding: any = export const controlNameBinding: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: NgControl,
provide: NgControl, useExisting: forwardRef(() => FormControlName)
useExisting: forwardRef(() => FormControlName) };
};
/** /**
* Syncs an existing form control with the specified name to a DOM element. * Syncs an existing form control with the specified name to a DOM element.

View File

@ -23,11 +23,10 @@ import {composeAsyncValidators, composeValidators, setUpControl, setUpFormContai
import {FormArrayName} from './form_array_name'; import {FormArrayName} from './form_array_name';
import {FormGroupName} from './form_group_name'; import {FormGroupName} from './form_group_name';
export const formDirectiveProvider: any = export const formDirectiveProvider: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: ControlContainer,
provide: ControlContainer, useExisting: forwardRef(() => FormGroupDirective)
useExisting: forwardRef(() => FormGroupDirective) };
};
/** /**
* Binds an existing form group to a DOM element. * Binds an existing form group to a DOM element.

View File

@ -16,11 +16,10 @@ import {ReactiveErrors} from '../reactive_errors';
import {FormGroupDirective} from './form_group_directive'; import {FormGroupDirective} from './form_group_directive';
export const formGroupNameProvider: any = export const formGroupNameProvider: any = {
/*@ts2dart_const*/ /* @ts2dart_Provider */ { provide: ControlContainer,
provide: ControlContainer, useExisting: forwardRef(() => FormGroupName)
useExisting: forwardRef(() => FormGroupName) };
};
/** /**
* Syncs an existing form group to a DOM element. * Syncs an existing form group to a DOM element.

View File

@ -13,7 +13,7 @@ import {StringWrapper, isBlank, isPresent, isPrimitive, looseIdentical} from '..
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
export const SELECT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const SELECT_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => SelectControlValueAccessor), useExisting: forwardRef(() => SelectControlValueAccessor),
multi: true multi: true

View File

@ -35,9 +35,9 @@ import {NG_VALIDATORS, Validators} from '../validators';
*/ */
export interface Validator { validate(c: AbstractControl): {[key: string]: any}; } export interface Validator { validate(c: AbstractControl): {[key: string]: any}; }
const REQUIRED = /*@ts2dart_const*/ Validators.required; const REQUIRED = Validators.required;
export const REQUIRED_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const REQUIRED_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useValue: REQUIRED, useValue: REQUIRED,
multi: true multi: true
@ -81,7 +81,7 @@ export interface AsyncValidatorFn {
* *
* {@example common/forms/ts/validators/validators.ts region='min'} * {@example common/forms/ts/validators/validators.ts region='min'}
*/ */
export const MIN_LENGTH_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const MIN_LENGTH_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useExisting: forwardRef(() => MinLengthValidator), useExisting: forwardRef(() => MinLengthValidator),
multi: true multi: true
@ -114,7 +114,7 @@ export class MinLengthValidator implements Validator {
* *
* {@example common/forms/ts/validators/validators.ts region='max'} * {@example common/forms/ts/validators/validators.ts region='max'}
*/ */
export const MAX_LENGTH_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const MAX_LENGTH_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useExisting: forwardRef(() => MaxLengthValidator), useExisting: forwardRef(() => MaxLengthValidator),
multi: true multi: true
@ -142,7 +142,7 @@ export class MaxLengthValidator implements Validator {
} }
export const PATTERN_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { export const PATTERN_VALIDATOR: any = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useExisting: forwardRef(() => PatternValidator), useExisting: forwardRef(() => PatternValidator),
multi: true multi: true

View File

@ -18,14 +18,13 @@ import {FormBuilder} from './form_builder';
* Shorthand set of providers used for building Angular forms. * Shorthand set of providers used for building Angular forms.
* @experimental * @experimental
*/ */
export const FORM_PROVIDERS: Type[] = /*@ts2dart_const*/[RadioControlRegistry]; export const FORM_PROVIDERS: Type[] = [RadioControlRegistry];
/** /**
* Shorthand set of providers used for building reactive Angular forms. * Shorthand set of providers used for building reactive Angular forms.
* @experimental * @experimental
*/ */
export const REACTIVE_FORM_PROVIDERS: Type[] = export const REACTIVE_FORM_PROVIDERS: Type[] = [FormBuilder, RadioControlRegistry];
/*@ts2dart_const*/[FormBuilder, RadioControlRegistry];
/** /**
* The ng module for forms. * The ng module for forms.

View File

@ -24,7 +24,7 @@ import {AbstractControl} from './model';
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'} * {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
* @experimental * @experimental
*/ */
export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('NgValidators'); export const NG_VALIDATORS: OpaqueToken = new OpaqueToken('NgValidators');
/** /**
* Providers for asynchronous validators to be used for {@link FormControl}s * Providers for asynchronous validators to be used for {@link FormControl}s
@ -36,8 +36,7 @@ export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Ng
* *
* @experimental * @experimental
*/ */
export const NG_ASYNC_VALIDATORS: OpaqueToken = export const NG_ASYNC_VALIDATORS: OpaqueToken = new OpaqueToken('NgAsyncValidators');
/*@ts2dart_const*/ new OpaqueToken('NgAsyncValidators');
/** /**
* Provides a set of validators used by form controls. * Provides a set of validators used by form controls.

View File

@ -15,7 +15,7 @@ import {isPresent} from '../src/facade/lang';
import {PromiseWrapper} from '../src/facade/promise'; import {PromiseWrapper} from '../src/facade/promise';
export function main() { export function main() {
function asyncValidator(expected: any /** TODO #9100 */, timeouts = /*@ts2dart_const*/ {}) { function asyncValidator(expected: any /** TODO #9100 */, timeouts = {}) {
return (c: any /** TODO #9100 */) => { return (c: any /** TODO #9100 */) => {
var completer = PromiseWrapper.completer(); var completer = PromiseWrapper.completer();
var t = isPresent((timeouts as any /** TODO #9100 */)[c.value]) ? var t = isPresent((timeouts as any /** TODO #9100 */)[c.value]) ?

View File

@ -1455,13 +1455,7 @@ function loginIsEmptyGroupValidator(c: FormGroup) {
@Directive({ @Directive({
selector: '[login-is-empty-validator]', selector: '[login-is-empty-validator]',
providers: [ providers: [{provide: NG_VALIDATORS, useValue: loginIsEmptyGroupValidator, multi: true}]
/* @ts2dart_Provider */ {
provide: NG_VALIDATORS,
useValue: loginIsEmptyGroupValidator,
multi: true
}
]
}) })
class LoginIsEmptyValidator { class LoginIsEmptyValidator {
} }

View File

@ -52,4 +52,4 @@ import {RouterLink} from './src/directives/router_link';
* bootstrap(AppCmp, [ROUTER_PROVIDERS]); * bootstrap(AppCmp, [ROUTER_PROVIDERS]);
* ``` * ```
*/ */
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink]; export const ROUTER_DIRECTIVES: any[] = [RouterOutlet, RouterLink];

View File

@ -83,7 +83,7 @@ export class RouteParams {
* ``` * ```
*/ */
export class RouteData { export class RouteData {
constructor(public data: {[key: string]: any} = /*@ts2dart_const*/ {}) {} constructor(public data: {[key: string]: any} = {}) {}
get(key: string): any { return normalizeBlank(StringMapWrapper.get(this.data, key)); } get(key: string): any { return normalizeBlank(StringMapWrapper.get(this.data, key)); }
} }
@ -256,7 +256,7 @@ export class DefaultInstruction extends ResolvedInstruction {
export class UnresolvedInstruction extends Instruction { export class UnresolvedInstruction extends Instruction {
constructor( constructor(
private _resolver: () => Promise<Instruction>, private _urlPath: string = '', private _resolver: () => Promise<Instruction>, private _urlPath: string = '',
private _urlParams: string[] = /*@ts2dart_const*/[]) { private _urlParams: string[] = []) {
super(null, null, {}); super(null, null, {});
} }

View File

@ -7,23 +7,17 @@
*/ */
/* @ts2dart_const */
export class RouteLifecycleHook { export class RouteLifecycleHook {
constructor(public name: string) {} constructor(public name: string) {}
} }
/* @ts2dart_const */
export class CanActivate { export class CanActivate {
constructor(public fn: Function) {} constructor(public fn: Function) {}
} }
export const routerCanReuse: RouteLifecycleHook = export const routerCanReuse: RouteLifecycleHook = new RouteLifecycleHook('routerCanReuse');
/*@ts2dart_const*/ new RouteLifecycleHook('routerCanReuse');
export const routerCanDeactivate: RouteLifecycleHook = export const routerCanDeactivate: RouteLifecycleHook =
/*@ts2dart_const*/ new RouteLifecycleHook('routerCanDeactivate'); new RouteLifecycleHook('routerCanDeactivate');
export const routerOnActivate: RouteLifecycleHook = export const routerOnActivate: RouteLifecycleHook = new RouteLifecycleHook('routerOnActivate');
/*@ts2dart_const*/ new RouteLifecycleHook('routerOnActivate'); export const routerOnReuse: RouteLifecycleHook = new RouteLifecycleHook('routerOnReuse');
export const routerOnReuse: RouteLifecycleHook = export const routerOnDeactivate: RouteLifecycleHook = new RouteLifecycleHook('routerOnDeactivate');
/*@ts2dart_const*/ new RouteLifecycleHook('routerOnReuse');
export const routerOnDeactivate: RouteLifecycleHook =
/*@ts2dart_const*/ new RouteLifecycleHook('routerOnDeactivate');

View File

@ -16,13 +16,11 @@ export {RouteDefinition} from '../route_definition';
* The `RouteConfig` decorator defines routes for a given component. * The `RouteConfig` decorator defines routes for a given component.
* *
* It takes an array of {@link RouteDefinition}s. * It takes an array of {@link RouteDefinition}s.
* @ts2dart_const
*/ */
export class RouteConfig { export class RouteConfig {
constructor(public configs: RouteDefinition[]) {} constructor(public configs: RouteDefinition[]) {}
} }
/* @ts2dart_const */
export abstract class AbstractRoute implements RouteDefinition { export abstract class AbstractRoute implements RouteDefinition {
name: string; name: string;
useAsDefault: boolean; useAsDefault: boolean;
@ -65,7 +63,6 @@ export abstract class AbstractRoute implements RouteDefinition {
* ]) * ])
* class MyApp {} * class MyApp {}
* ``` * ```
* @ts2dart_const
*/ */
export class Route extends AbstractRoute { export class Route extends AbstractRoute {
component: any; component: any;
@ -105,7 +102,6 @@ export class Route extends AbstractRoute {
* ]) * ])
* class MyApp {} * class MyApp {}
* ``` * ```
* @ts2dart_const
*/ */
export class AuxRoute extends AbstractRoute { export class AuxRoute extends AbstractRoute {
component: any; component: any;
@ -148,7 +144,6 @@ export class AuxRoute extends AbstractRoute {
* ]) * ])
* class MyApp {} * class MyApp {}
* ``` * ```
* @ts2dart_const
*/ */
export class AsyncRoute extends AbstractRoute { export class AsyncRoute extends AbstractRoute {
loader: () => Promise<Type>; loader: () => Promise<Type>;
@ -189,7 +184,6 @@ export class AsyncRoute extends AbstractRoute {
* ]) * ])
* class MyApp {} * class MyApp {}
* ``` * ```
* @ts2dart_const
*/ */
export class Redirect extends AbstractRoute { export class Redirect extends AbstractRoute {
redirectTo: any[]; redirectTo: any[];

View File

@ -58,8 +58,7 @@ var _resolveToNull = PromiseWrapper.resolve<Instruction>(null);
* bootstrap(AppCmp, [ROUTER_PROVIDERS]); * bootstrap(AppCmp, [ROUTER_PROVIDERS]);
* ``` * ```
*/ */
export const ROUTER_PRIMARY_COMPONENT: OpaqueToken = export const ROUTER_PRIMARY_COMPONENT: OpaqueToken = new OpaqueToken('RouterPrimaryComponent');
/*@ts2dart_const*/ new OpaqueToken('RouterPrimaryComponent');
/** /**

View File

@ -36,10 +36,9 @@ import {ROUTER_PROVIDERS_COMMON} from './router_providers_common';
* bootstrap(AppCmp, [ROUTER_PROVIDERS]); * bootstrap(AppCmp, [ROUTER_PROVIDERS]);
* ``` * ```
*/ */
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[ export const ROUTER_PROVIDERS: any[] = [
ROUTER_PROVIDERS_COMMON, ROUTER_PROVIDERS_COMMON,
/*@ts2dart_const*/ ( ({provide: PlatformLocation, useClass: BrowserPlatformLocation}),
/* @ts2dart_Provider */ {provide: PlatformLocation, useClass: BrowserPlatformLocation}),
]; ];
/** /**
@ -47,4 +46,4 @@ export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
* *
* @deprecated * @deprecated
*/ */
export const ROUTER_BINDINGS = /*@ts2dart_const*/ ROUTER_PROVIDERS; export const ROUTER_BINDINGS = ROUTER_PROVIDERS;

View File

@ -19,9 +19,8 @@ import {RootRouter, Router} from './router';
/** /**
* The Platform agnostic ROUTER PROVIDERS * The Platform agnostic ROUTER PROVIDERS
*/ */
export const ROUTER_PROVIDERS_COMMON: any[] = /*@ts2dart_const*/[ export const ROUTER_PROVIDERS_COMMON: any[] = [
RouteRegistry, RouteRegistry, {provide: LocationStrategy, useClass: PathLocationStrategy}, Location, {
/* @ts2dart_Provider */ {provide: LocationStrategy, useClass: PathLocationStrategy}, Location, {
provide: Router, provide: Router,
useFactory: routerFactory, useFactory: routerFactory,
deps: [RouteRegistry, Location, ROUTER_PRIMARY_COMPONENT, ApplicationRef] deps: [RouteRegistry, Location, ROUTER_PRIMARY_COMPONENT, ApplicationRef]
@ -29,7 +28,7 @@ export const ROUTER_PROVIDERS_COMMON: any[] = /*@ts2dart_const*/[
{ {
provide: ROUTER_PRIMARY_COMPONENT, provide: ROUTER_PRIMARY_COMPONENT,
useFactory: routerPrimaryComponentFactory, useFactory: routerPrimaryComponentFactory,
deps: /*@ts2dart_const*/ ([ApplicationRef]) deps: [ApplicationRef]
} }
]; ];

View File

@ -32,8 +32,8 @@ export function serializeParams(urlParams: {[key: string]: any}, joiner = '&'):
*/ */
export class Url { export class Url {
constructor( constructor(
public path: string, public child: Url = null, public auxiliary: Url[] = /*@ts2dart_const*/[], public path: string, public child: Url = null, public auxiliary: Url[] = [],
public params: {[key: string]: any} = /*@ts2dart_const*/ {}) {} public params: {[key: string]: any} = {}) {}
toString(): string { toString(): string {
return this.path + this._matrixParamsToString() + this._auxToString() + this._childString(); return this.path + this._matrixParamsToString() + this._auxToString() + this._childString();
@ -61,9 +61,8 @@ export class Url {
} }
export class RootUrl extends Url { export class RootUrl extends Url {
constructor( constructor(path: string, child: Url = null, auxiliary: Url[] = [], params: {[key: string]:
path: string, child: Url = null, auxiliary: Url[] = /*@ts2dart_const*/[], any} = null) {
params: {[key: string]: any} = null) {
super(path, child, auxiliary, params); super(path, child, auxiliary, params);
} }

View File

@ -17,8 +17,7 @@ export function main() {
var locationStrategy: any /** TODO #9100 */, location: any /** TODO #9100 */; var locationStrategy: any /** TODO #9100 */, location: any /** TODO #9100 */;
function makeLocation( function makeLocation(baseHref: string = '/my/app', provider: any = []): Location {
baseHref: string = '/my/app', provider: any = /*@ts2dart_const*/[]): Location {
locationStrategy = new MockLocationStrategy(); locationStrategy = new MockLocationStrategy();
locationStrategy.internalBaseHref = baseHref; locationStrategy.internalBaseHref = baseHref;
let injector = ReflectiveInjector.resolveAndCreate( let injector = ReflectiveInjector.resolveAndCreate(

View File

@ -47,7 +47,7 @@ function creditCardValidator(c: any /** TODO #9100 */): {[key: string]: boolean}
} }
} }
const creditCardValidatorBinding = /** @ts2dart_const */ /** @ts2dart_Provider */ { const creditCardValidatorBinding = {
provide: NG_VALIDATORS, provide: NG_VALIDATORS,
useValue: creditCardValidator, useValue: creditCardValidator,
multi: true multi: true

View File

@ -1,32 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../dist/packages-ts2dart/",
"paths": {
"selenium-webdriver": ["@angular/typings/selenium-webdriver/selenium-webdriver.d.ts"],
"rxjs/*": ["../node_modules/rxjs/*"],
"@angular/upgrade": ["./upgrade-ts2dart.d.ts"],
"@angular/*": ["./@angular/*"]
},
"rootDir": ".",
"sourceMap": true,
"sourceRoot": ".",
"target": "es6"
},
"exclude": [
"@angular/upgrade/",
"@angular/core/test/typings.d.ts",
"@angular/manual_typings/globals.d.ts",
"@angular/typings/es6-collections/es6-collections.d.ts",
"@angular/typings/es6-promise/es6-promise.d.ts",
"@angular/typings/tsd.d.ts",
"@angular/typings.d.ts",
"angular1_router",
"rollup-test"
]
}

View File

@ -28,8 +28,6 @@
"benchpress", "benchpress",
"payload_tests", "payload_tests",
"rollup-test", "rollup-test",
"upgrade-ts2dart.d.ts",
"zone-ts2dart.d.ts",
"@angular/compiler-cli/integrationtest" "@angular/compiler-cli/integrationtest"
] ]
} }

View File

@ -1,4 +0,0 @@
// This file is here to mock out ts2dart imports of upgrade.
export type UpgradeAdapter = any;
export var UpgradeAdapter: any;

View File

@ -1,5 +0,0 @@
declare type Zone = any;
declare var Zone: any;
declare type ZoneDelegate = any;
declare type HasTaskState = any;
declare type Task = any;