refactor: remove ts2dart annotations
This commit is contained in:
parent
13c8211065
commit
28c4852cd6
|
@ -55,4 +55,4 @@ import {CORE_DIRECTIVES} from './directives';
|
|||
*
|
||||
* @experimental Contains forms which are experimental.
|
||||
*/
|
||||
export const COMMON_DIRECTIVES: Type[][] = /*@ts2dart_const*/[CORE_DIRECTIVES];
|
||||
export const COMMON_DIRECTIVES: Type[][] = [CORE_DIRECTIVES];
|
||||
|
|
|
@ -58,7 +58,7 @@ import {NgTemplateOutlet} from './ng_template_outlet';
|
|||
*
|
||||
* @stable
|
||||
*/
|
||||
export const CORE_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
||||
export const CORE_DIRECTIVES: Type[] = [
|
||||
NgClass,
|
||||
NgFor,
|
||||
NgIf,
|
||||
|
|
|
@ -57,7 +57,7 @@ export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './forms-deprecated
|
|||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const FORM_PROVIDERS: Type[] = /*@ts2dart_const*/[FormBuilder, RadioControlRegistry];
|
||||
export const FORM_PROVIDERS: Type[] = [FormBuilder, RadioControlRegistry];
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -58,7 +58,7 @@ export {MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValida
|
|||
* ```
|
||||
* @experimental
|
||||
*/
|
||||
export const FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
||||
export const FORM_DIRECTIVES: Type[] = [
|
||||
NgControlName,
|
||||
NgControlGroup,
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import {Directive, ElementRef, Renderer, forwardRef} from '@angular/core';
|
|||
|
||||
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,
|
||||
useExisting: forwardRef(() => CheckboxControlValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -41,5 +41,4 @@ export interface ControlValueAccessor {
|
|||
* See {@link DefaultValueAccessor} for how to implement one.
|
||||
* @experimental
|
||||
*/
|
||||
export const NG_VALUE_ACCESSOR: OpaqueToken =
|
||||
/*@ts2dart_const*/ new OpaqueToken('NgValueAccessor');
|
||||
export const NG_VALUE_ACCESSOR: OpaqueToken = new OpaqueToken('NgValueAccessor');
|
||||
|
|
|
@ -12,12 +12,11 @@ import {isBlank} from '../../facade/lang';
|
|||
|
||||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
||||
|
||||
export const DEFAULT_VALUE_ACCESSOR: any = /*@ts2dart_const*/
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
useExisting: forwardRef(() => DefaultValueAccessor),
|
||||
multi: true
|
||||
};
|
||||
export const DEFAULT_VALUE_ACCESSOR: any = {
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
useExisting: forwardRef(() => DefaultValueAccessor),
|
||||
multi: true
|
||||
};
|
||||
|
||||
/**
|
||||
* The default accessor for writing a value and listening to changes that is used by the
|
||||
|
|
|
@ -16,11 +16,10 @@ import {Form} from './form_interface';
|
|||
import {composeAsyncValidators, composeValidators, controlPath} from './shared';
|
||||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||
|
||||
export const controlGroupProvider: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgControlGroup)
|
||||
};
|
||||
export const controlGroupProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgControlGroup)
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates and binds a control group to a DOM element.
|
||||
|
|
|
@ -19,11 +19,10 @@ import {composeAsyncValidators, composeValidators, controlPath, isPropertyUpdate
|
|||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||
|
||||
|
||||
export const controlNameBinding: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgControlName)
|
||||
};
|
||||
export const controlNameBinding: any = {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgControlName)
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates and binds a control with a specified name to a DOM element.
|
||||
|
|
|
@ -20,8 +20,10 @@ import {NgControl} from './ng_control';
|
|||
import {NgControlGroup} from './ng_control_group';
|
||||
import {composeAsyncValidators, composeValidators, setUpControl, setUpControlGroup} from './shared';
|
||||
|
||||
export const formDirectiveProvider: any =
|
||||
/*@ts2dart_const*/ {provide: ControlContainer, useExisting: forwardRef(() => NgForm)};
|
||||
export const formDirectiveProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgForm)
|
||||
};
|
||||
|
||||
let _formWarningDisplayed: boolean = false;
|
||||
|
||||
|
|
|
@ -18,11 +18,10 @@ import {NgControl} from './ng_control';
|
|||
import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from './shared';
|
||||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||
|
||||
export const formControlBinding: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgFormControl)
|
||||
};
|
||||
export const formControlBinding: any = {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgFormControl)
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds an existing {@link Control} to a DOM element.
|
||||
|
|
|
@ -21,11 +21,10 @@ import {NgControl} from './ng_control';
|
|||
import {NgControlGroup} from './ng_control_group';
|
||||
import {composeAsyncValidators, composeValidators, setUpControl, setUpControlGroup} from './shared';
|
||||
|
||||
export const formDirectiveProvider: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgFormModel)
|
||||
};
|
||||
export const formDirectiveProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgFormModel)
|
||||
};
|
||||
|
||||
let _formModelWarningDisplayed: boolean = false;
|
||||
|
||||
|
|
|
@ -17,11 +17,10 @@ import {NgControl} from './ng_control';
|
|||
import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from './shared';
|
||||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||
|
||||
export const formControlBinding: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgModel)
|
||||
};
|
||||
export const formControlBinding: any = {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgModel)
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds a domain model to a form control.
|
||||
|
|
|
@ -12,7 +12,7 @@ import {NumberWrapper, isBlank} from '../../facade/lang';
|
|||
|
||||
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,
|
||||
useExisting: forwardRef(() => NumberValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -14,7 +14,7 @@ import {isPresent} from '../../facade/lang';
|
|||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
||||
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,
|
||||
useExisting: forwardRef(() => RadioControlValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -13,7 +13,7 @@ import {StringWrapper, isBlank, isPresent, isPrimitive, looseIdentical} from '..
|
|||
|
||||
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,
|
||||
useExisting: forwardRef(() => SelectControlValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -35,9 +35,9 @@ import {NG_VALIDATORS, Validators} from '../validators';
|
|||
*/
|
||||
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,
|
||||
useValue: REQUIRED,
|
||||
multi: true
|
||||
|
@ -74,7 +74,7 @@ export interface AsyncValidatorFn {
|
|||
*
|
||||
* {@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,
|
||||
useExisting: forwardRef(() => MinLengthValidator),
|
||||
multi: true
|
||||
|
@ -107,7 +107,7 @@ export class MinLengthValidator implements Validator {
|
|||
*
|
||||
* {@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,
|
||||
useExisting: forwardRef(() => MaxLengthValidator),
|
||||
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,
|
||||
useExisting: forwardRef(() => PatternValidator),
|
||||
multi: true
|
||||
|
|
|
@ -24,7 +24,7 @@ import {AbstractControl} from './model';
|
|||
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
|
||||
* @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
|
||||
|
@ -36,8 +36,7 @@ export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Ng
|
|||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const NG_ASYNC_VALIDATORS: OpaqueToken =
|
||||
/*@ts2dart_const*/ new OpaqueToken('NgAsyncValidators');
|
||||
export const NG_ASYNC_VALIDATORS: OpaqueToken = new OpaqueToken('NgAsyncValidators');
|
||||
|
||||
/**
|
||||
* Provides a set of validators used by form controls.
|
||||
|
|
|
@ -69,4 +69,4 @@ export abstract class LocationStrategy {
|
|||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export const APP_BASE_HREF: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('appBaseHref');
|
||||
export const APP_BASE_HREF: OpaqueToken = new OpaqueToken('appBaseHref');
|
||||
|
|
|
@ -32,7 +32,7 @@ import {UpperCasePipe} from './uppercase_pipe';
|
|||
*
|
||||
* @experimental Contains i18n pipes which are experimental
|
||||
*/
|
||||
export const COMMON_PIPES = /*@ts2dart_const*/[
|
||||
export const COMMON_PIPES = [
|
||||
AsyncPipe,
|
||||
UpperCasePipe,
|
||||
LowerCasePipe,
|
||||
|
|
|
@ -1519,13 +1519,7 @@ function loginIsEmptyGroupValidator(c: ControlGroup) {
|
|||
|
||||
@Directive({
|
||||
selector: '[login-is-empty-validator]',
|
||||
providers: [
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: NG_VALIDATORS,
|
||||
useValue: loginIsEmptyGroupValidator,
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
providers: [{provide: NG_VALIDATORS, useValue: loginIsEmptyGroupValidator, multi: true}]
|
||||
})
|
||||
class LoginIsEmptyValidator {
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import {PromiseWrapper} from '../../src/facade/promise';
|
|||
import {TimerWrapper, ObservableWrapper, EventEmitter} from '../../src/facade/async';
|
||||
|
||||
export function main() {
|
||||
function asyncValidator(expected: any /** TODO #9100 */, timeouts = /*@ts2dart_const*/ {}) {
|
||||
function asyncValidator(expected: any /** TODO #9100 */, timeouts = {}) {
|
||||
return (c: any /** TODO #9100 */) => {
|
||||
var completer = PromiseWrapper.completer();
|
||||
var t = isPresent((timeouts as any /** TODO #9100 */)[c.value]) ?
|
||||
|
|
|
@ -52,32 +52,31 @@ const _NO_XHR: XHR = {
|
|||
* A set of providers that provide `RuntimeCompiler` and its dependencies to use for
|
||||
* template compilation.
|
||||
*/
|
||||
export const COMPILER_PROVIDERS: Array<any|Type|{[k: string]: any}|any[]> =
|
||||
/*@ts2dart_const*/[
|
||||
{provide: Reflector, useValue: reflector},
|
||||
{provide: ReflectorReader, useExisting: Reflector},
|
||||
{provide: XHR, useValue: _NO_XHR},
|
||||
Console,
|
||||
Lexer,
|
||||
Parser,
|
||||
HtmlParser,
|
||||
TemplateParser,
|
||||
DirectiveNormalizer,
|
||||
CompileMetadataResolver,
|
||||
DEFAULT_PACKAGE_URL_PROVIDER,
|
||||
StyleCompiler,
|
||||
ViewCompiler,
|
||||
NgModuleCompiler,
|
||||
/*@ts2dart_Provider*/ {provide: CompilerConfig, useValue: new CompilerConfig()},
|
||||
RuntimeCompiler,
|
||||
/*@ts2dart_Provider*/ {provide: Compiler, useExisting: RuntimeCompiler},
|
||||
DomElementSchemaRegistry,
|
||||
/*@ts2dart_Provider*/ {provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry},
|
||||
UrlResolver,
|
||||
DirectiveResolver,
|
||||
PipeResolver,
|
||||
NgModuleResolver
|
||||
];
|
||||
export const COMPILER_PROVIDERS: Array<any|Type|{[k: string]: any}|any[]> = [
|
||||
{provide: Reflector, useValue: reflector},
|
||||
{provide: ReflectorReader, useExisting: Reflector},
|
||||
{provide: XHR, useValue: _NO_XHR},
|
||||
Console,
|
||||
Lexer,
|
||||
Parser,
|
||||
HtmlParser,
|
||||
TemplateParser,
|
||||
DirectiveNormalizer,
|
||||
CompileMetadataResolver,
|
||||
DEFAULT_PACKAGE_URL_PROVIDER,
|
||||
StyleCompiler,
|
||||
ViewCompiler,
|
||||
NgModuleCompiler,
|
||||
{provide: CompilerConfig, useValue: new CompilerConfig()},
|
||||
RuntimeCompiler,
|
||||
{provide: Compiler, useExisting: RuntimeCompiler},
|
||||
DomElementSchemaRegistry,
|
||||
{provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry},
|
||||
UrlResolver,
|
||||
DirectiveResolver,
|
||||
PipeResolver,
|
||||
NgModuleResolver
|
||||
];
|
||||
|
||||
|
||||
export function analyzeAppProvidersForDeprecatedConfiguration(appProviders: any[] = []):
|
||||
|
|
|
@ -567,7 +567,7 @@ export class ClassStmt extends Statement {
|
|||
export class IfStmt extends Statement {
|
||||
constructor(
|
||||
public condition: Expression, public trueCase: Statement[],
|
||||
public falseCase: Statement[] = /*@ts2dart_const*/[]) {
|
||||
public falseCase: Statement[] = []) {
|
||||
super();
|
||||
}
|
||||
visitStatement(visitor: StatementVisitor, context: any): any {
|
||||
|
|
|
@ -75,154 +75,153 @@ const OBJECT = 'object';
|
|||
//
|
||||
// =================================================================================================
|
||||
|
||||
const SCHEMA: string[] =
|
||||
/*@ts2dart_const*/ ([
|
||||
'*|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',
|
||||
'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:graphics^:svg:|',
|
||||
':svg:animation^:svg:|*begin,*end,*repeat',
|
||||
':svg:geometry^:svg:|',
|
||||
':svg:componentTransferFunction^:svg:|',
|
||||
':svg:gradient^:svg:|',
|
||||
':svg:textContent^:svg:graphics|',
|
||||
':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',
|
||||
'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerpolicy,search,shape,target,username',
|
||||
'audio^media|',
|
||||
'br|clear',
|
||||
'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',
|
||||
'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
|
||||
'canvas|#height,#width',
|
||||
'content|select',
|
||||
'dl|!compact',
|
||||
'datalist|',
|
||||
'details|!open',
|
||||
'dialog|!open,returnValue',
|
||||
'dir|!compact',
|
||||
'div|align',
|
||||
'embed|align,height,name,src,type,width',
|
||||
'fieldset|!disabled,name',
|
||||
'font|color,face,size',
|
||||
'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
|
||||
'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',
|
||||
'hr|align,color,!noShade,size,width',
|
||||
'head|',
|
||||
'h1,h2,h3,h4,h5,h6|align',
|
||||
'html|version',
|
||||
'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',
|
||||
'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',
|
||||
'li|type,#value',
|
||||
'label|htmlFor',
|
||||
'legend|align',
|
||||
'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',
|
||||
'map|name',
|
||||
'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
|
||||
'menu|!compact',
|
||||
'meta|content,httpEquiv,name,scheme',
|
||||
'meter|#high,#low,#max,#min,#optimum,#value',
|
||||
'ins,del|cite,dateTime',
|
||||
'ol|!compact,!reversed,#start,type',
|
||||
'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
|
||||
'optgroup|!disabled,label',
|
||||
'option|!defaultSelected,!disabled,label,!selected,text,value',
|
||||
'output|defaultValue,%htmlFor,name,value',
|
||||
'p|align',
|
||||
'param|name,type,value,valueType',
|
||||
'picture|',
|
||||
'pre|#width',
|
||||
'progress|#max,#value',
|
||||
'q,blockquote,cite|',
|
||||
'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
|
||||
'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
|
||||
'shadow|',
|
||||
'source|media,sizes,src,srcset,type',
|
||||
'span|',
|
||||
'style|!disabled,media,type',
|
||||
'caption|align',
|
||||
'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
|
||||
'col,colgroup|align,ch,chOff,#span,vAlign,width',
|
||||
'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
|
||||
'tr|align,bgColor,ch,chOff,vAlign',
|
||||
'tfoot,thead,tbody|align,ch,chOff,vAlign',
|
||||
'template|',
|
||||
'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
|
||||
'title|text',
|
||||
'track|!default,kind,label,src,srclang',
|
||||
'ul|!compact,type',
|
||||
'unknown|',
|
||||
'video^media|#height,poster,#width',
|
||||
':svg:a^:svg:graphics|',
|
||||
':svg:animate^:svg:animation|',
|
||||
':svg:animateMotion^:svg:animation|',
|
||||
':svg:animateTransform^:svg:animation|',
|
||||
':svg:circle^:svg:geometry|',
|
||||
':svg:clipPath^:svg:graphics|',
|
||||
':svg:cursor^:svg:|',
|
||||
':svg:defs^:svg:graphics|',
|
||||
':svg:desc^:svg:|',
|
||||
':svg:discard^:svg:|',
|
||||
':svg:ellipse^:svg:geometry|',
|
||||
':svg:feBlend^:svg:|',
|
||||
':svg:feColorMatrix^:svg:|',
|
||||
':svg:feComponentTransfer^:svg:|',
|
||||
':svg:feComposite^:svg:|',
|
||||
':svg:feConvolveMatrix^:svg:|',
|
||||
':svg:feDiffuseLighting^:svg:|',
|
||||
':svg:feDisplacementMap^:svg:|',
|
||||
':svg:feDistantLight^:svg:|',
|
||||
':svg:feDropShadow^:svg:|',
|
||||
':svg:feFlood^:svg:|',
|
||||
':svg:feFuncA^:svg:componentTransferFunction|',
|
||||
':svg:feFuncB^:svg:componentTransferFunction|',
|
||||
':svg:feFuncG^:svg:componentTransferFunction|',
|
||||
':svg:feFuncR^:svg:componentTransferFunction|',
|
||||
':svg:feGaussianBlur^:svg:|',
|
||||
':svg:feImage^:svg:|',
|
||||
':svg:feMerge^:svg:|',
|
||||
':svg:feMergeNode^:svg:|',
|
||||
':svg:feMorphology^:svg:|',
|
||||
':svg:feOffset^:svg:|',
|
||||
':svg:fePointLight^:svg:|',
|
||||
':svg:feSpecularLighting^:svg:|',
|
||||
':svg:feSpotLight^:svg:|',
|
||||
':svg:feTile^:svg:|',
|
||||
':svg:feTurbulence^:svg:|',
|
||||
':svg:filter^:svg:|',
|
||||
':svg:foreignObject^:svg:graphics|',
|
||||
':svg:g^:svg:graphics|',
|
||||
':svg:image^:svg:graphics|',
|
||||
':svg:line^:svg:geometry|',
|
||||
':svg:linearGradient^:svg:gradient|',
|
||||
':svg:mpath^:svg:|',
|
||||
':svg:marker^:svg:|',
|
||||
':svg:mask^:svg:|',
|
||||
':svg:metadata^:svg:|',
|
||||
':svg:path^:svg:geometry|',
|
||||
':svg:pattern^:svg:|',
|
||||
':svg:polygon^:svg:geometry|',
|
||||
':svg:polyline^:svg:geometry|',
|
||||
':svg:radialGradient^:svg:gradient|',
|
||||
':svg:rect^:svg:geometry|',
|
||||
':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',
|
||||
':svg:script^:svg:|type',
|
||||
':svg:set^:svg:animation|',
|
||||
':svg:stop^:svg:|',
|
||||
':svg:style^:svg:|!disabled,media,title,type',
|
||||
':svg:switch^:svg:graphics|',
|
||||
':svg:symbol^:svg:|',
|
||||
':svg:tspan^:svg:textPositioning|',
|
||||
':svg:text^:svg:textPositioning|',
|
||||
':svg:textPath^:svg:textContent|',
|
||||
':svg:title^:svg:|',
|
||||
':svg:use^:svg:graphics|',
|
||||
':svg:view^:svg:|#zoomAndPan',
|
||||
]);
|
||||
const SCHEMA: string[] = ([
|
||||
'*|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',
|
||||
'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:graphics^:svg:|',
|
||||
':svg:animation^:svg:|*begin,*end,*repeat',
|
||||
':svg:geometry^:svg:|',
|
||||
':svg:componentTransferFunction^:svg:|',
|
||||
':svg:gradient^:svg:|',
|
||||
':svg:textContent^:svg:graphics|',
|
||||
':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',
|
||||
'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerpolicy,search,shape,target,username',
|
||||
'audio^media|',
|
||||
'br|clear',
|
||||
'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',
|
||||
'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
|
||||
'canvas|#height,#width',
|
||||
'content|select',
|
||||
'dl|!compact',
|
||||
'datalist|',
|
||||
'details|!open',
|
||||
'dialog|!open,returnValue',
|
||||
'dir|!compact',
|
||||
'div|align',
|
||||
'embed|align,height,name,src,type,width',
|
||||
'fieldset|!disabled,name',
|
||||
'font|color,face,size',
|
||||
'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
|
||||
'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',
|
||||
'hr|align,color,!noShade,size,width',
|
||||
'head|',
|
||||
'h1,h2,h3,h4,h5,h6|align',
|
||||
'html|version',
|
||||
'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',
|
||||
'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',
|
||||
'li|type,#value',
|
||||
'label|htmlFor',
|
||||
'legend|align',
|
||||
'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',
|
||||
'map|name',
|
||||
'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
|
||||
'menu|!compact',
|
||||
'meta|content,httpEquiv,name,scheme',
|
||||
'meter|#high,#low,#max,#min,#optimum,#value',
|
||||
'ins,del|cite,dateTime',
|
||||
'ol|!compact,!reversed,#start,type',
|
||||
'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
|
||||
'optgroup|!disabled,label',
|
||||
'option|!defaultSelected,!disabled,label,!selected,text,value',
|
||||
'output|defaultValue,%htmlFor,name,value',
|
||||
'p|align',
|
||||
'param|name,type,value,valueType',
|
||||
'picture|',
|
||||
'pre|#width',
|
||||
'progress|#max,#value',
|
||||
'q,blockquote,cite|',
|
||||
'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
|
||||
'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
|
||||
'shadow|',
|
||||
'source|media,sizes,src,srcset,type',
|
||||
'span|',
|
||||
'style|!disabled,media,type',
|
||||
'caption|align',
|
||||
'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
|
||||
'col,colgroup|align,ch,chOff,#span,vAlign,width',
|
||||
'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
|
||||
'tr|align,bgColor,ch,chOff,vAlign',
|
||||
'tfoot,thead,tbody|align,ch,chOff,vAlign',
|
||||
'template|',
|
||||
'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
|
||||
'title|text',
|
||||
'track|!default,kind,label,src,srclang',
|
||||
'ul|!compact,type',
|
||||
'unknown|',
|
||||
'video^media|#height,poster,#width',
|
||||
':svg:a^:svg:graphics|',
|
||||
':svg:animate^:svg:animation|',
|
||||
':svg:animateMotion^:svg:animation|',
|
||||
':svg:animateTransform^:svg:animation|',
|
||||
':svg:circle^:svg:geometry|',
|
||||
':svg:clipPath^:svg:graphics|',
|
||||
':svg:cursor^:svg:|',
|
||||
':svg:defs^:svg:graphics|',
|
||||
':svg:desc^:svg:|',
|
||||
':svg:discard^:svg:|',
|
||||
':svg:ellipse^:svg:geometry|',
|
||||
':svg:feBlend^:svg:|',
|
||||
':svg:feColorMatrix^:svg:|',
|
||||
':svg:feComponentTransfer^:svg:|',
|
||||
':svg:feComposite^:svg:|',
|
||||
':svg:feConvolveMatrix^:svg:|',
|
||||
':svg:feDiffuseLighting^:svg:|',
|
||||
':svg:feDisplacementMap^:svg:|',
|
||||
':svg:feDistantLight^:svg:|',
|
||||
':svg:feDropShadow^:svg:|',
|
||||
':svg:feFlood^:svg:|',
|
||||
':svg:feFuncA^:svg:componentTransferFunction|',
|
||||
':svg:feFuncB^:svg:componentTransferFunction|',
|
||||
':svg:feFuncG^:svg:componentTransferFunction|',
|
||||
':svg:feFuncR^:svg:componentTransferFunction|',
|
||||
':svg:feGaussianBlur^:svg:|',
|
||||
':svg:feImage^:svg:|',
|
||||
':svg:feMerge^:svg:|',
|
||||
':svg:feMergeNode^:svg:|',
|
||||
':svg:feMorphology^:svg:|',
|
||||
':svg:feOffset^:svg:|',
|
||||
':svg:fePointLight^:svg:|',
|
||||
':svg:feSpecularLighting^:svg:|',
|
||||
':svg:feSpotLight^:svg:|',
|
||||
':svg:feTile^:svg:|',
|
||||
':svg:feTurbulence^:svg:|',
|
||||
':svg:filter^:svg:|',
|
||||
':svg:foreignObject^:svg:graphics|',
|
||||
':svg:g^:svg:graphics|',
|
||||
':svg:image^:svg:graphics|',
|
||||
':svg:line^:svg:geometry|',
|
||||
':svg:linearGradient^:svg:gradient|',
|
||||
':svg:mpath^:svg:|',
|
||||
':svg:marker^:svg:|',
|
||||
':svg:mask^:svg:|',
|
||||
':svg:metadata^:svg:|',
|
||||
':svg:path^:svg:geometry|',
|
||||
':svg:pattern^:svg:|',
|
||||
':svg:polygon^:svg:geometry|',
|
||||
':svg:polyline^:svg:geometry|',
|
||||
':svg:radialGradient^:svg:gradient|',
|
||||
':svg:rect^:svg:geometry|',
|
||||
':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',
|
||||
':svg:script^:svg:|type',
|
||||
':svg:set^:svg:animation|',
|
||||
':svg:stop^:svg:|',
|
||||
':svg:style^:svg:|!disabled,media,title,type',
|
||||
':svg:switch^:svg:graphics|',
|
||||
':svg:symbol^:svg:|',
|
||||
':svg:tspan^:svg:textPositioning|',
|
||||
':svg:text^:svg:textPositioning|',
|
||||
':svg:textPath^:svg:textContent|',
|
||||
':svg:title^:svg:|',
|
||||
':svg:use^:svg:graphics|',
|
||||
':svg:view^:svg:|#zoomAndPan',
|
||||
]);
|
||||
|
||||
var attrToPropMap: {[name: string]: string} = <any>{
|
||||
'class': 'className',
|
||||
|
|
|
@ -10,7 +10,7 @@ import {ListWrapper} from './facade/collection';
|
|||
import {BaseException} from './facade/exceptions';
|
||||
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
|
||||
// in Dart this is not transpiled into `final` yet...
|
||||
|
|
|
@ -63,7 +63,7 @@ const TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];
|
|||
*
|
||||
* 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 {
|
||||
constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel) {
|
||||
|
|
|
@ -163,7 +163,7 @@ class ListDir1Alt {
|
|||
class ListDir2 {
|
||||
}
|
||||
|
||||
const LIST_CHILDREN = /*@ts2dart_const*/[ListDir1, ListDir2];
|
||||
const LIST_CHILDREN = [ListDir1, ListDir2];
|
||||
|
||||
@Component({
|
||||
selector: 'directive-list-comp',
|
||||
|
|
|
@ -21,7 +21,7 @@ import {OpaqueToken} from './di';
|
|||
* using this token.
|
||||
* @experimental
|
||||
*/
|
||||
export const APP_ID: any = /*@ts2dart_const*/ new OpaqueToken('AppId');
|
||||
export const APP_ID: any = new OpaqueToken('AppId');
|
||||
|
||||
export function _appIdRandomProviderFactory() {
|
||||
return `${_randomChar()}${_randomChar()}${_randomChar()}`;
|
||||
|
@ -31,12 +31,11 @@ export function _appIdRandomProviderFactory() {
|
|||
* Providers that will generate a random APP_ID_TOKEN.
|
||||
* @experimental
|
||||
*/
|
||||
export const APP_ID_RANDOM_PROVIDER =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: APP_ID,
|
||||
useFactory: _appIdRandomProviderFactory,
|
||||
deps: <any[]>[]
|
||||
};
|
||||
export const APP_ID_RANDOM_PROVIDER = {
|
||||
provide: APP_ID,
|
||||
useFactory: _appIdRandomProviderFactory,
|
||||
deps: <any[]>[]
|
||||
};
|
||||
|
||||
function _randomChar(): string {
|
||||
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.
|
||||
* @experimental
|
||||
*/
|
||||
export const PLATFORM_INITIALIZER: any =
|
||||
/*@ts2dart_const*/ new OpaqueToken('Platform Initializer');
|
||||
export const PLATFORM_INITIALIZER: any = new OpaqueToken('Platform Initializer');
|
||||
|
||||
/**
|
||||
* A function that will be executed when an application is initialized.
|
||||
* @experimental
|
||||
*/
|
||||
export const APP_INITIALIZER: any =
|
||||
/*@ts2dart_const*/ new OpaqueToken('Application Initializer');
|
||||
export const APP_INITIALIZER: any = new OpaqueToken('Application Initializer');
|
||||
|
||||
/**
|
||||
* A token which indicates the root directory of the application
|
||||
* @experimental
|
||||
*/
|
||||
export const PACKAGE_ROOT_URL: any =
|
||||
/*@ts2dart_const*/ new OpaqueToken('Application Packages Root URL');
|
||||
export const PACKAGE_ROOT_URL: any = new OpaqueToken('Application Packages Root URL');
|
||||
|
|
|
@ -27,15 +27,13 @@ export {PipeTransform} from './pipe_transform';
|
|||
/**
|
||||
* Structural diffing for `Object`s and `Map`s.
|
||||
*/
|
||||
export const keyValDiff: KeyValueDifferFactory[] =
|
||||
/*@ts2dart_const*/[new DefaultKeyValueDifferFactory()];
|
||||
export const keyValDiff: KeyValueDifferFactory[] = [new DefaultKeyValueDifferFactory()];
|
||||
|
||||
/**
|
||||
* Structural diffing for `Iterable` types such as `Array`s.
|
||||
*/
|
||||
export const iterableDiff: IterableDifferFactory[] =
|
||||
/*@ts2dart_const*/[new DefaultIterableDifferFactory()];
|
||||
export const iterableDiff: IterableDifferFactory[] = [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);
|
||||
|
|
|
@ -14,7 +14,6 @@ import {ChangeDetectorRef} from '../change_detector_ref';
|
|||
import {IterableDiffer, IterableDifferFactory, TrackByFn} from './iterable_differs';
|
||||
|
||||
|
||||
/* @ts2dart_const */
|
||||
export class DefaultIterableDifferFactory implements IterableDifferFactory {
|
||||
constructor() {}
|
||||
supports(obj: Object): boolean { return isListLikeIterable(obj); }
|
||||
|
|
|
@ -45,11 +45,9 @@ export interface IterableDifferFactory {
|
|||
|
||||
/**
|
||||
* A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class IterableDiffers {
|
||||
/*@ts2dart_const*/
|
||||
constructor(public factories: IterableDifferFactory[]) {}
|
||||
|
||||
static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers {
|
||||
|
|
|
@ -35,11 +35,9 @@ export interface KeyValueDifferFactory {
|
|||
|
||||
/**
|
||||
* A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class KeyValueDiffers {
|
||||
/*@ts2dart_const*/
|
||||
constructor(public factories: KeyValueDifferFactory[]) {}
|
||||
|
||||
static create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers {
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
import {BaseException, unimplemented} from '../facade/exceptions';
|
||||
import {stringify} from '../facade/lang';
|
||||
|
||||
const _THROW_IF_NOT_FOUND = /*@ts2dart_const*/ new Object();
|
||||
export const THROW_IF_NOT_FOUND = /*@ts2dart_const*/ _THROW_IF_NOT_FOUND;
|
||||
const _THROW_IF_NOT_FOUND = new Object();
|
||||
export const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
|
||||
|
||||
class _NullInjector implements Injector {
|
||||
get(token: any, notFoundValue: any = _THROW_IF_NOT_FOUND): any {
|
||||
|
|
|
@ -47,7 +47,6 @@ import {stringify} from '../facade/lang';
|
|||
* var injector = Injector.resolveAndCreate([Engine, Car]);
|
||||
* expect(injector.get(Car).engine instanceof Engine).toBe(true);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class InjectMetadata {
|
||||
|
@ -75,7 +74,6 @@ export class InjectMetadata {
|
|||
* var injector = Injector.resolveAndCreate([Car]);
|
||||
* expect(injector.get(Car).engine).toBeNull();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class OptionalMetadata {
|
||||
|
@ -85,7 +83,6 @@ export class OptionalMetadata {
|
|||
/**
|
||||
* `DependencyMetadata` is used by the framework to extend DI.
|
||||
* This is internal to Angular and should not be used directly.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class DependencyMetadata {
|
||||
|
@ -122,7 +119,6 @@ export class DependencyMetadata {
|
|||
* var injector = Injector.resolveAndCreate([NeedsService, UsefulService]);
|
||||
* expect(() => injector.get(NeedsService)).toThrowError();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class InjectableMetadata {
|
||||
|
@ -155,7 +151,6 @@ export class InjectableMetadata {
|
|||
* var child = inj.resolveAndCreateChild([NeedsDependency]);
|
||||
* expect(() => child.get(NeedsDependency)).toThrowError();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class SelfMetadata {
|
||||
|
@ -186,7 +181,6 @@ export class SelfMetadata {
|
|||
* var inj = Injector.resolveAndCreate([Dependency, NeedsDependency]);
|
||||
* expect(() => inj.get(NeedsDependency)).toThrowError();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class SkipSelfMetadata {
|
||||
|
@ -246,7 +240,6 @@ export class SkipSelfMetadata {
|
|||
*
|
||||
* bootstrap(App);
|
||||
*```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class HostMetadata {
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
*
|
||||
* Using an `OpaqueToken` is preferable to using an `Object` as tokens because it provides better
|
||||
* error messages.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class OpaqueToken {
|
||||
|
|
|
@ -24,7 +24,6 @@ import {Type, isBlank, isFunction, isType, normalizeBool, stringify} from '../fa
|
|||
*
|
||||
* expect(injector.get("message")).toEqual('Hello');
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @deprecated
|
||||
*/
|
||||
export class Provider {
|
||||
|
@ -211,7 +210,6 @@ export class Provider {
|
|||
* See {@link Provider} instead.
|
||||
*
|
||||
* @deprecated
|
||||
* @ts2dart_const
|
||||
*/
|
||||
export class Binding extends Provider {
|
||||
constructor(token: any, {toClass, toValue, toAlias, toFactory, deps, multi}: {
|
||||
|
|
|
@ -21,7 +21,7 @@ var __unused: Type; // avoid unused import when Type union types are erased
|
|||
|
||||
// Threshold for the dynamic version
|
||||
const _MAX_CONSTRUCTION_COUNTER = 10;
|
||||
const UNDEFINED = /*@ts2dart_const*/ new Object();
|
||||
const UNDEFINED = new Object();
|
||||
|
||||
export interface ReflectiveProtoInjectorStrategy {
|
||||
getProviderAtIndex(index: number): ResolvedReflectiveProvider;
|
||||
|
@ -629,7 +629,7 @@ export class ReflectiveInjector_ implements ReflectiveInjector {
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -81,7 +81,6 @@ export class ComponentRef_<C> extends ComponentRef<C> {
|
|||
|
||||
/**
|
||||
* @experimental
|
||||
* @ts2dart_const
|
||||
*/
|
||||
const EMPTY_CONTEXT = new Object();
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import {DebugAppView} from './view';
|
|||
import {ViewType} from './view_type';
|
||||
|
||||
|
||||
/* @ts2dart_const */
|
||||
export class StaticNodeDebugInfo {
|
||||
constructor(
|
||||
public providerTokens: any[], public componentToken: any,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {Injector, THROW_IF_NOT_FOUND} from '../di/injector';
|
||||
import {AppView} from './view';
|
||||
|
||||
const _UNDEFINED = /*@ts2dart_const*/ new Object();
|
||||
const _UNDEFINED = new Object();
|
||||
|
||||
export class ElementInjector extends Injector {
|
||||
constructor(private _view: AppView<any>, private _nodeIndex: number) { super(); }
|
||||
|
|
|
@ -12,7 +12,7 @@ import {ElementRef} from './element_ref';
|
|||
import {AppView} from './view';
|
||||
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.
|
||||
|
|
|
@ -70,7 +70,7 @@ function _flattenNestedViewRenderNodes(nodes: any[], renderNodes: any[]): any[]
|
|||
return renderNodes;
|
||||
}
|
||||
|
||||
const EMPTY_ARR: any[] = /*@ts2dart_const*/[];
|
||||
const EMPTY_ARR: any[] = [];
|
||||
|
||||
export function ensureSlotCount(projectableNodes: any[][], expectedSlotCount: number): any[][] {
|
||||
var res: any[][];
|
||||
|
|
|
@ -63,7 +63,6 @@ export const ANALYZE_FOR_ENTRY_COMPONENTS = new OpaqueToken('AnalyzeForEntryComp
|
|||
* A decorator can inject string literal `text` like so:
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class AttributeMetadata extends DependencyMetadata {
|
||||
|
@ -186,7 +185,6 @@ export class AttributeMetadata extends DependencyMetadata {
|
|||
*
|
||||
* The injected object is an unmodifiable live list.
|
||||
* See {@link QueryList} for more details.
|
||||
* @ts2dart_const
|
||||
* @deprecated
|
||||
*/
|
||||
export class QueryMetadata extends DependencyMetadata {
|
||||
|
@ -256,7 +254,6 @@ export class QueryMetadata extends DependencyMetadata {
|
|||
* }
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ContentChildrenMetadata extends QueryMetadata {
|
||||
|
@ -287,7 +284,6 @@ export class ContentChildrenMetadata extends QueryMetadata {
|
|||
* }
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ContentChildMetadata extends QueryMetadata {
|
||||
|
@ -330,7 +326,6 @@ export class ContentChildMetadata extends QueryMetadata {
|
|||
*
|
||||
* The injected object is an iterable and observable live list.
|
||||
* See {@link QueryList} for more details.
|
||||
* @ts2dart_const
|
||||
* @deprecated
|
||||
*/
|
||||
export class ViewQueryMetadata extends QueryMetadata {
|
||||
|
@ -423,7 +418,6 @@ export class ViewQueryMetadata extends QueryMetadata {
|
|||
* }
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ViewChildrenMetadata extends ViewQueryMetadata {
|
||||
|
@ -501,7 +495,6 @@ export class ViewChildrenMetadata extends ViewQueryMetadata {
|
|||
* }
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ViewChildMetadata extends ViewQueryMetadata {
|
||||
|
|
|
@ -408,7 +408,6 @@ export interface DirectiveMetadataType {
|
|||
* Note also that although the `<li></li>` template still exists inside the `<template></template>`,
|
||||
* the instantiated
|
||||
* view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class DirectiveMetadata extends InjectableMetadata implements DirectiveMetadataType {
|
||||
|
@ -824,7 +823,6 @@ export interface ComponentMetadataType extends DirectiveMetadataType {
|
|||
* ### Example
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='component'}
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ComponentMetadata extends DirectiveMetadata implements ComponentMetadataType {
|
||||
|
@ -1095,7 +1093,6 @@ export interface PipeMetadataType {
|
|||
* ### Example
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='pipe'}
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class PipeMetadata extends InjectableMetadata implements PipeMetadataType {
|
||||
|
@ -1152,7 +1149,6 @@ export class PipeMetadata extends InjectableMetadata implements PipeMetadataType
|
|||
*
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class InputMetadata {
|
||||
|
@ -1203,7 +1199,6 @@ export class InputMetadata {
|
|||
* }
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class OutputMetadata {
|
||||
|
@ -1244,7 +1239,6 @@ export class OutputMetadata {
|
|||
*
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class HostBindingMetadata {
|
||||
|
@ -1284,7 +1278,6 @@ export class HostBindingMetadata {
|
|||
*
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class HostListenerMetadata {
|
||||
|
|
|
@ -71,7 +71,6 @@ export var VIEW_ENCAPSULATION_VALUES =
|
|||
* }
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
*
|
||||
* @deprecated Use ComponentMetadata instead.
|
||||
*/
|
||||
|
|
|
@ -36,8 +36,7 @@ import {OpaqueToken} from './di';
|
|||
* @deprecated Providing platform directives via a provider is deprecated. Provide platform
|
||||
* directives via an {@link NgModule} instead.
|
||||
*/
|
||||
export const PLATFORM_DIRECTIVES: OpaqueToken =
|
||||
/*@ts2dart_const*/ new OpaqueToken('Platform Directives');
|
||||
export const PLATFORM_DIRECTIVES: OpaqueToken = new OpaqueToken('Platform Directives');
|
||||
|
||||
/**
|
||||
* 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
|
||||
* {@link NgModule} instead.
|
||||
*/
|
||||
export const PLATFORM_PIPES: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Platform Pipes');
|
||||
export const PLATFORM_PIPES: OpaqueToken = new OpaqueToken('Platform Pipes');
|
||||
|
|
|
@ -11,12 +11,10 @@ import {WtfScopeFn, createScope, detectWTF, endTimeRange, leave, startTimeRange}
|
|||
export {WtfScopeFn} from './wtf_impl';
|
||||
|
||||
|
||||
// Change exports to const once https://github.com/angular/ts2dart/issues/150
|
||||
|
||||
/**
|
||||
* True if WTF is enabled.
|
||||
*/
|
||||
export var wtfEnabled = detectWTF();
|
||||
export const wtfEnabled = detectWTF();
|
||||
|
||||
function noopScope(arg0?: any, arg1?: any): any {
|
||||
return null;
|
||||
|
|
|
@ -148,7 +148,6 @@ export interface GetTestability {
|
|||
Testability;
|
||||
}
|
||||
|
||||
/* @ts2dart_const */
|
||||
class _NoopGetTestability implements GetTestability {
|
||||
addToWindow(registry: TestabilityRegistry): void {}
|
||||
findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):
|
||||
|
@ -165,4 +164,4 @@ export function setTestabilityGetter(getter: GetTestability): void {
|
|||
_testabilityGetter = getter;
|
||||
}
|
||||
|
||||
var _testabilityGetter: GetTestability = /*@ts2dart_const*/ new _NoopGetTestability();
|
||||
var _testabilityGetter: GetTestability = new _NoopGetTestability();
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
import {isBlank} from '../../src/facade/lang';
|
||||
|
||||
export function iterableChangesAsString(
|
||||
{collection = /*@ts2dart_const*/[] as any, previous = /*@ts2dart_const*/[] as any,
|
||||
additions = /*@ts2dart_const*/[] as any, moves = /*@ts2dart_const*/[] as any,
|
||||
removals = /*@ts2dart_const*/[] as any,
|
||||
identityChanges = /*@ts2dart_const*/[] as any}): string {
|
||||
{collection = [] as any, previous = [] as any, additions = [] as any, moves = [] as any,
|
||||
removals = [] as any, identityChanges = [] as any}): string {
|
||||
return 'collection: ' + collection.join(', ') + '\n' +
|
||||
'previous: ' + previous.join(', ') + '\n' +
|
||||
'additions: ' + additions.join(', ') + '\n' +
|
||||
|
|
|
@ -1129,7 +1129,7 @@ export function main() {
|
|||
});
|
||||
}
|
||||
|
||||
const ALL_DIRECTIVES = /*@ts2dart_const*/[
|
||||
const ALL_DIRECTIVES = [
|
||||
forwardRef(() => TestDirective),
|
||||
forwardRef(() => TestComponent),
|
||||
forwardRef(() => AnotherComponent),
|
||||
|
@ -1144,7 +1144,7 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/[
|
|||
NgFor,
|
||||
];
|
||||
|
||||
const ALL_PIPES = /*@ts2dart_const*/[
|
||||
const ALL_PIPES = [
|
||||
forwardRef(() => CountingPipe),
|
||||
forwardRef(() => CountingImpurePipe),
|
||||
forwardRef(() => MultiArgPipe),
|
||||
|
|
|
@ -36,7 +36,7 @@ import {TemplateRef, TemplateRef_} from '@angular/core/src/linker/template_ref';
|
|||
import {Renderer} from '@angular/core/src/render';
|
||||
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() {
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
|
@ -2416,9 +2416,7 @@ class PublicApi {
|
|||
|
||||
@Directive({
|
||||
selector: '[public-api]',
|
||||
providers: [
|
||||
/* @ts2dart_Provider */ {provide: PublicApi, useExisting: PrivateImpl, deps: []}
|
||||
]
|
||||
providers: [{provide: PublicApi, useExisting: PrivateImpl, deps: []}]
|
||||
})
|
||||
class PrivateImpl extends PublicApi {
|
||||
}
|
||||
|
@ -2482,13 +2480,8 @@ function createInjectableWithLogging(inj: Injector) {
|
|||
|
||||
@Component({
|
||||
selector: 'component-providing-logging-injectable',
|
||||
providers: [
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: InjectableService,
|
||||
useFactory: createInjectableWithLogging,
|
||||
deps: [Injector]
|
||||
}
|
||||
],
|
||||
providers:
|
||||
[{provide: InjectableService, useFactory: createInjectableWithLogging, deps: [Injector]}],
|
||||
template: ''
|
||||
})
|
||||
class ComponentProvidingLoggingInjectable {
|
||||
|
@ -2510,8 +2503,8 @@ class DirectiveProvidingInjectableInView {
|
|||
|
||||
@Component({
|
||||
selector: 'directive-providing-injectable',
|
||||
providers: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'host'}],
|
||||
viewProviders: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'view'}],
|
||||
providers: [{provide: InjectableService, useValue: 'host'}],
|
||||
viewProviders: [{provide: InjectableService, useValue: 'view'}],
|
||||
template: ''
|
||||
})
|
||||
class DirectiveProvidingInjectableInHostAndView {
|
||||
|
@ -2545,7 +2538,6 @@ class DirectiveConsumingInjectableUnbounded {
|
|||
}
|
||||
|
||||
|
||||
/* @ts2dart_const */
|
||||
class EventBus {
|
||||
parentEventBus: EventBus;
|
||||
name: string;
|
||||
|
@ -2558,9 +2550,7 @@ class EventBus {
|
|||
|
||||
@Directive({
|
||||
selector: 'grand-parent-providing-event-bus',
|
||||
providers: [
|
||||
/* @ts2dart_Provider */ {provide: EventBus, useValue: new EventBus(null, 'grandparent')}
|
||||
]
|
||||
providers: [{provide: EventBus, useValue: new EventBus(null, 'grandparent')}]
|
||||
})
|
||||
class GrandParentProvidingEventBus {
|
||||
bus: EventBus;
|
||||
|
|
|
@ -14,7 +14,7 @@ import {Type, ViewContainerRef, TemplateRef, ElementRef, ChangeDetectorRef, Chan
|
|||
import {NgIf, NgFor} from '@angular/common';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
|
||||
const ALL_DIRECTIVES = /*@ts2dart_const*/[
|
||||
const ALL_DIRECTIVES = [
|
||||
forwardRef(() => SimpleDirective),
|
||||
forwardRef(() => CycleDirective),
|
||||
forwardRef(() => SimpleComponent),
|
||||
|
@ -49,7 +49,7 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/[
|
|||
NgFor
|
||||
];
|
||||
|
||||
const ALL_PIPES = /*@ts2dart_const*/[
|
||||
const ALL_PIPES = [
|
||||
forwardRef(() => PipeNeedsChangeDetectorRef),
|
||||
forwardRef(() => PipeNeedsService),
|
||||
forwardRef(() => PurePipe),
|
||||
|
|
|
@ -60,7 +60,7 @@ export function main() {
|
|||
|
||||
describe('const', () => {
|
||||
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]);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -44,18 +44,17 @@ export {NgSelectOption, SelectControlValueAccessor} from './directives/select_co
|
|||
export {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor';
|
||||
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,
|
||||
CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor,
|
||||
RadioControlValueAccessor, NgControlStatus, RequiredValidator, MinLengthValidator,
|
||||
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*/[
|
||||
FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName
|
||||
];
|
||||
export const REACTIVE_DRIVEN_DIRECTIVES: Type[] =
|
||||
[FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -74,15 +73,14 @@ export const REACTIVE_DRIVEN_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
|||
* ```
|
||||
* @experimental
|
||||
*/
|
||||
export const FORM_DIRECTIVES: Type[][] =
|
||||
/*@ts2dart_const*/[TEMPLATE_DRIVEN_DIRECTIVES, SHARED_FORM_DIRECTIVES];
|
||||
export const FORM_DIRECTIVES: Type[][] = [TEMPLATE_DRIVEN_DIRECTIVES, SHARED_FORM_DIRECTIVES];
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
|
||||
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
|
||||
|
|
|
@ -10,7 +10,7 @@ import {Directive, ElementRef, Renderer, forwardRef} from '@angular/core';
|
|||
|
||||
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,
|
||||
useExisting: forwardRef(() => CheckboxControlValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -41,5 +41,4 @@ export interface ControlValueAccessor {
|
|||
* See {@link DefaultValueAccessor} for how to implement one.
|
||||
* @experimental
|
||||
*/
|
||||
export const NG_VALUE_ACCESSOR: OpaqueToken =
|
||||
/*@ts2dart_const*/ new OpaqueToken('NgValueAccessor');
|
||||
export const NG_VALUE_ACCESSOR: OpaqueToken = new OpaqueToken('NgValueAccessor');
|
||||
|
|
|
@ -12,12 +12,11 @@ import {isBlank} from '../facade/lang';
|
|||
|
||||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
||||
|
||||
export const DEFAULT_VALUE_ACCESSOR: any = /*@ts2dart_const*/
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
useExisting: forwardRef(() => DefaultValueAccessor),
|
||||
multi: true
|
||||
};
|
||||
export const DEFAULT_VALUE_ACCESSOR: any = {
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
useExisting: forwardRef(() => DefaultValueAccessor),
|
||||
multi: true
|
||||
};
|
||||
|
||||
/**
|
||||
* The default accessor for writing a value and listening to changes that is used by the
|
||||
|
|
|
@ -21,8 +21,10 @@ import {NgModel} from './ng_model';
|
|||
import {NgModelGroup} from './ng_model_group';
|
||||
import {composeAsyncValidators, composeValidators, setUpControl, setUpFormContainer} from './shared';
|
||||
|
||||
export const formDirectiveProvider: any =
|
||||
/*@ts2dart_const*/ {provide: ControlContainer, useExisting: forwardRef(() => NgForm)};
|
||||
export const formDirectiveProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgForm)
|
||||
};
|
||||
|
||||
/**
|
||||
* If `NgForm` is bound in a component, `<form>` elements in that component will be
|
||||
|
|
|
@ -23,11 +23,10 @@ import {composeAsyncValidators, composeValidators, controlPath, isPropertyUpdate
|
|||
import {TemplateDrivenErrors} from './template_driven_errors';
|
||||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||
|
||||
export const formControlBinding: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgModel)
|
||||
};
|
||||
export const formControlBinding: any = {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => NgModel)
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds a domain model to a form control.
|
||||
|
|
|
@ -16,11 +16,10 @@ import {ControlContainer} from './control_container';
|
|||
import {NgForm} from './ng_form';
|
||||
import {TemplateDrivenErrors} from './template_driven_errors';
|
||||
|
||||
export const modelGroupProvider: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgModelGroup)
|
||||
};
|
||||
export const modelGroupProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => NgModelGroup)
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates and binds a model group to a DOM element.
|
||||
|
|
|
@ -12,7 +12,7 @@ import {NumberWrapper, isBlank} from '../facade/lang';
|
|||
|
||||
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,
|
||||
useExisting: forwardRef(() => NumberValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -15,7 +15,7 @@ import {isPresent} from '../facade/lang';
|
|||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
||||
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,
|
||||
useExisting: forwardRef(() => RadioControlValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -19,11 +19,10 @@ import {AsyncValidatorFn, ValidatorFn} from '../validators';
|
|||
import {FormGroupDirective} from './form_group_directive';
|
||||
import {FormGroupName} from './form_group_name';
|
||||
|
||||
export const formArrayNameProvider: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => FormArrayName)
|
||||
};
|
||||
export const formArrayNameProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => FormArrayName)
|
||||
};
|
||||
|
||||
/**
|
||||
* Syncs an existing form array to a DOM element.
|
||||
|
|
|
@ -18,11 +18,10 @@ import {NgControl} from '../ng_control';
|
|||
import {composeAsyncValidators, composeValidators, isPropertyUpdated, selectValueAccessor, setUpControl} from '../shared';
|
||||
import {AsyncValidatorFn, ValidatorFn} from '../validators';
|
||||
|
||||
export const formControlBinding: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => FormControlDirective)
|
||||
};
|
||||
export const formControlBinding: any = {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => FormControlDirective)
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds an existing {@link FormControl} to a DOM element.
|
||||
|
|
|
@ -25,11 +25,10 @@ import {FormGroupDirective} from './form_group_directive';
|
|||
import {FormGroupName} from './form_group_name';
|
||||
|
||||
|
||||
export const controlNameBinding: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => FormControlName)
|
||||
};
|
||||
export const controlNameBinding: any = {
|
||||
provide: NgControl,
|
||||
useExisting: forwardRef(() => FormControlName)
|
||||
};
|
||||
|
||||
/**
|
||||
* Syncs an existing form control with the specified name to a DOM element.
|
||||
|
|
|
@ -23,11 +23,10 @@ import {composeAsyncValidators, composeValidators, setUpControl, setUpFormContai
|
|||
import {FormArrayName} from './form_array_name';
|
||||
import {FormGroupName} from './form_group_name';
|
||||
|
||||
export const formDirectiveProvider: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => FormGroupDirective)
|
||||
};
|
||||
export const formDirectiveProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => FormGroupDirective)
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds an existing form group to a DOM element.
|
||||
|
|
|
@ -16,11 +16,10 @@ import {ReactiveErrors} from '../reactive_errors';
|
|||
|
||||
import {FormGroupDirective} from './form_group_directive';
|
||||
|
||||
export const formGroupNameProvider: any =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => FormGroupName)
|
||||
};
|
||||
export const formGroupNameProvider: any = {
|
||||
provide: ControlContainer,
|
||||
useExisting: forwardRef(() => FormGroupName)
|
||||
};
|
||||
|
||||
/**
|
||||
* Syncs an existing form group to a DOM element.
|
||||
|
|
|
@ -13,7 +13,7 @@ import {StringWrapper, isBlank, isPresent, isPrimitive, looseIdentical} from '..
|
|||
|
||||
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,
|
||||
useExisting: forwardRef(() => SelectControlValueAccessor),
|
||||
multi: true
|
||||
|
|
|
@ -35,9 +35,9 @@ import {NG_VALIDATORS, Validators} from '../validators';
|
|||
*/
|
||||
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,
|
||||
useValue: REQUIRED,
|
||||
multi: true
|
||||
|
@ -81,7 +81,7 @@ export interface AsyncValidatorFn {
|
|||
*
|
||||
* {@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,
|
||||
useExisting: forwardRef(() => MinLengthValidator),
|
||||
multi: true
|
||||
|
@ -114,7 +114,7 @@ export class MinLengthValidator implements Validator {
|
|||
*
|
||||
* {@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,
|
||||
useExisting: forwardRef(() => MaxLengthValidator),
|
||||
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,
|
||||
useExisting: forwardRef(() => PatternValidator),
|
||||
multi: true
|
||||
|
|
|
@ -18,14 +18,13 @@ import {FormBuilder} from './form_builder';
|
|||
* Shorthand set of providers used for building Angular forms.
|
||||
* @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.
|
||||
* @experimental
|
||||
*/
|
||||
export const REACTIVE_FORM_PROVIDERS: Type[] =
|
||||
/*@ts2dart_const*/[FormBuilder, RadioControlRegistry];
|
||||
export const REACTIVE_FORM_PROVIDERS: Type[] = [FormBuilder, RadioControlRegistry];
|
||||
|
||||
/**
|
||||
* The ng module for forms.
|
||||
|
|
|
@ -24,7 +24,7 @@ import {AbstractControl} from './model';
|
|||
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
|
||||
* @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
|
||||
|
@ -36,8 +36,7 @@ export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Ng
|
|||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const NG_ASYNC_VALIDATORS: OpaqueToken =
|
||||
/*@ts2dart_const*/ new OpaqueToken('NgAsyncValidators');
|
||||
export const NG_ASYNC_VALIDATORS: OpaqueToken = new OpaqueToken('NgAsyncValidators');
|
||||
|
||||
/**
|
||||
* Provides a set of validators used by form controls.
|
||||
|
|
|
@ -15,7 +15,7 @@ import {isPresent} from '../src/facade/lang';
|
|||
import {PromiseWrapper} from '../src/facade/promise';
|
||||
|
||||
export function main() {
|
||||
function asyncValidator(expected: any /** TODO #9100 */, timeouts = /*@ts2dart_const*/ {}) {
|
||||
function asyncValidator(expected: any /** TODO #9100 */, timeouts = {}) {
|
||||
return (c: any /** TODO #9100 */) => {
|
||||
var completer = PromiseWrapper.completer();
|
||||
var t = isPresent((timeouts as any /** TODO #9100 */)[c.value]) ?
|
||||
|
|
|
@ -1455,13 +1455,7 @@ function loginIsEmptyGroupValidator(c: FormGroup) {
|
|||
|
||||
@Directive({
|
||||
selector: '[login-is-empty-validator]',
|
||||
providers: [
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: NG_VALIDATORS,
|
||||
useValue: loginIsEmptyGroupValidator,
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
providers: [{provide: NG_VALIDATORS, useValue: loginIsEmptyGroupValidator, multi: true}]
|
||||
})
|
||||
class LoginIsEmptyValidator {
|
||||
}
|
||||
|
|
|
@ -52,4 +52,4 @@ import {RouterLink} from './src/directives/router_link';
|
|||
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
||||
* ```
|
||||
*/
|
||||
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink];
|
||||
export const ROUTER_DIRECTIVES: any[] = [RouterOutlet, RouterLink];
|
||||
|
|
|
@ -83,7 +83,7 @@ export class RouteParams {
|
|||
* ```
|
||||
*/
|
||||
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)); }
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ export class DefaultInstruction extends ResolvedInstruction {
|
|||
export class UnresolvedInstruction extends Instruction {
|
||||
constructor(
|
||||
private _resolver: () => Promise<Instruction>, private _urlPath: string = '',
|
||||
private _urlParams: string[] = /*@ts2dart_const*/[]) {
|
||||
private _urlParams: string[] = []) {
|
||||
super(null, null, {});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,23 +7,17 @@
|
|||
*/
|
||||
|
||||
|
||||
/* @ts2dart_const */
|
||||
export class RouteLifecycleHook {
|
||||
constructor(public name: string) {}
|
||||
}
|
||||
|
||||
/* @ts2dart_const */
|
||||
export class CanActivate {
|
||||
constructor(public fn: Function) {}
|
||||
}
|
||||
|
||||
export const routerCanReuse: RouteLifecycleHook =
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook('routerCanReuse');
|
||||
export const routerCanReuse: RouteLifecycleHook = new RouteLifecycleHook('routerCanReuse');
|
||||
export const routerCanDeactivate: RouteLifecycleHook =
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook('routerCanDeactivate');
|
||||
export const routerOnActivate: RouteLifecycleHook =
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook('routerOnActivate');
|
||||
export const routerOnReuse: RouteLifecycleHook =
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook('routerOnReuse');
|
||||
export const routerOnDeactivate: RouteLifecycleHook =
|
||||
/*@ts2dart_const*/ new RouteLifecycleHook('routerOnDeactivate');
|
||||
new RouteLifecycleHook('routerCanDeactivate');
|
||||
export const routerOnActivate: RouteLifecycleHook = new RouteLifecycleHook('routerOnActivate');
|
||||
export const routerOnReuse: RouteLifecycleHook = new RouteLifecycleHook('routerOnReuse');
|
||||
export const routerOnDeactivate: RouteLifecycleHook = new RouteLifecycleHook('routerOnDeactivate');
|
||||
|
|
|
@ -16,13 +16,11 @@ export {RouteDefinition} from '../route_definition';
|
|||
* The `RouteConfig` decorator defines routes for a given component.
|
||||
*
|
||||
* It takes an array of {@link RouteDefinition}s.
|
||||
* @ts2dart_const
|
||||
*/
|
||||
export class RouteConfig {
|
||||
constructor(public configs: RouteDefinition[]) {}
|
||||
}
|
||||
|
||||
/* @ts2dart_const */
|
||||
export abstract class AbstractRoute implements RouteDefinition {
|
||||
name: string;
|
||||
useAsDefault: boolean;
|
||||
|
@ -65,7 +63,6 @@ export abstract class AbstractRoute implements RouteDefinition {
|
|||
* ])
|
||||
* class MyApp {}
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
*/
|
||||
export class Route extends AbstractRoute {
|
||||
component: any;
|
||||
|
@ -105,7 +102,6 @@ export class Route extends AbstractRoute {
|
|||
* ])
|
||||
* class MyApp {}
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
*/
|
||||
export class AuxRoute extends AbstractRoute {
|
||||
component: any;
|
||||
|
@ -148,7 +144,6 @@ export class AuxRoute extends AbstractRoute {
|
|||
* ])
|
||||
* class MyApp {}
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
*/
|
||||
export class AsyncRoute extends AbstractRoute {
|
||||
loader: () => Promise<Type>;
|
||||
|
@ -189,7 +184,6 @@ export class AsyncRoute extends AbstractRoute {
|
|||
* ])
|
||||
* class MyApp {}
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
*/
|
||||
export class Redirect extends AbstractRoute {
|
||||
redirectTo: any[];
|
||||
|
|
|
@ -58,8 +58,7 @@ var _resolveToNull = PromiseWrapper.resolve<Instruction>(null);
|
|||
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
||||
* ```
|
||||
*/
|
||||
export const ROUTER_PRIMARY_COMPONENT: OpaqueToken =
|
||||
/*@ts2dart_const*/ new OpaqueToken('RouterPrimaryComponent');
|
||||
export const ROUTER_PRIMARY_COMPONENT: OpaqueToken = new OpaqueToken('RouterPrimaryComponent');
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,10 +36,9 @@ import {ROUTER_PROVIDERS_COMMON} from './router_providers_common';
|
|||
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
|
||||
* ```
|
||||
*/
|
||||
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
|
||||
export const ROUTER_PROVIDERS: any[] = [
|
||||
ROUTER_PROVIDERS_COMMON,
|
||||
/*@ts2dart_const*/ (
|
||||
/* @ts2dart_Provider */ {provide: PlatformLocation, useClass: BrowserPlatformLocation}),
|
||||
({provide: PlatformLocation, useClass: BrowserPlatformLocation}),
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -47,4 +46,4 @@ export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
|
|||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export const ROUTER_BINDINGS = /*@ts2dart_const*/ ROUTER_PROVIDERS;
|
||||
export const ROUTER_BINDINGS = ROUTER_PROVIDERS;
|
||||
|
|
|
@ -19,9 +19,8 @@ import {RootRouter, Router} from './router';
|
|||
/**
|
||||
* The Platform agnostic ROUTER PROVIDERS
|
||||
*/
|
||||
export const ROUTER_PROVIDERS_COMMON: any[] = /*@ts2dart_const*/[
|
||||
RouteRegistry,
|
||||
/* @ts2dart_Provider */ {provide: LocationStrategy, useClass: PathLocationStrategy}, Location, {
|
||||
export const ROUTER_PROVIDERS_COMMON: any[] = [
|
||||
RouteRegistry, {provide: LocationStrategy, useClass: PathLocationStrategy}, Location, {
|
||||
provide: Router,
|
||||
useFactory: routerFactory,
|
||||
deps: [RouteRegistry, Location, ROUTER_PRIMARY_COMPONENT, ApplicationRef]
|
||||
|
@ -29,7 +28,7 @@ export const ROUTER_PROVIDERS_COMMON: any[] = /*@ts2dart_const*/[
|
|||
{
|
||||
provide: ROUTER_PRIMARY_COMPONENT,
|
||||
useFactory: routerPrimaryComponentFactory,
|
||||
deps: /*@ts2dart_const*/ ([ApplicationRef])
|
||||
deps: [ApplicationRef]
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ export function serializeParams(urlParams: {[key: string]: any}, joiner = '&'):
|
|||
*/
|
||||
export class Url {
|
||||
constructor(
|
||||
public path: string, public child: Url = null, public auxiliary: Url[] = /*@ts2dart_const*/[],
|
||||
public params: {[key: string]: any} = /*@ts2dart_const*/ {}) {}
|
||||
public path: string, public child: Url = null, public auxiliary: Url[] = [],
|
||||
public params: {[key: string]: any} = {}) {}
|
||||
|
||||
toString(): string {
|
||||
return this.path + this._matrixParamsToString() + this._auxToString() + this._childString();
|
||||
|
@ -61,9 +61,8 @@ export class Url {
|
|||
}
|
||||
|
||||
export class RootUrl extends Url {
|
||||
constructor(
|
||||
path: string, child: Url = null, auxiliary: Url[] = /*@ts2dart_const*/[],
|
||||
params: {[key: string]: any} = null) {
|
||||
constructor(path: string, child: Url = null, auxiliary: Url[] = [], params: {[key: string]:
|
||||
any} = null) {
|
||||
super(path, child, auxiliary, params);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,7 @@ export function main() {
|
|||
|
||||
var locationStrategy: any /** TODO #9100 */, location: any /** TODO #9100 */;
|
||||
|
||||
function makeLocation(
|
||||
baseHref: string = '/my/app', provider: any = /*@ts2dart_const*/[]): Location {
|
||||
function makeLocation(baseHref: string = '/my/app', provider: any = []): Location {
|
||||
locationStrategy = new MockLocationStrategy();
|
||||
locationStrategy.internalBaseHref = baseHref;
|
||||
let injector = ReflectiveInjector.resolveAndCreate(
|
||||
|
|
|
@ -47,7 +47,7 @@ function creditCardValidator(c: any /** TODO #9100 */): {[key: string]: boolean}
|
|||
}
|
||||
}
|
||||
|
||||
const creditCardValidatorBinding = /** @ts2dart_const */ /** @ts2dart_Provider */ {
|
||||
const creditCardValidatorBinding = {
|
||||
provide: NG_VALIDATORS,
|
||||
useValue: creditCardValidator,
|
||||
multi: true
|
||||
|
|
|
@ -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"
|
||||
]
|
||||
}
|
|
@ -28,8 +28,6 @@
|
|||
"benchpress",
|
||||
"payload_tests",
|
||||
"rollup-test",
|
||||
"upgrade-ts2dart.d.ts",
|
||||
"zone-ts2dart.d.ts",
|
||||
"@angular/compiler-cli/integrationtest"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
// This file is here to mock out ts2dart imports of upgrade.
|
||||
|
||||
export type UpgradeAdapter = any;
|
||||
export var UpgradeAdapter: any;
|
|
@ -1,5 +0,0 @@
|
|||
declare type Zone = any;
|
||||
declare var Zone: any;
|
||||
declare type ZoneDelegate = any;
|
||||
declare type HasTaskState = any;
|
||||
declare type Task = any;
|
Loading…
Reference in New Issue