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.
|
* @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
|
* @stable
|
||||||
*/
|
*/
|
||||||
export const CORE_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
export const CORE_DIRECTIVES: Type[] = [
|
||||||
NgClass,
|
NgClass,
|
||||||
NgFor,
|
NgFor,
|
||||||
NgIf,
|
NgIf,
|
||||||
|
|
|
@ -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];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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,
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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');
|
|
||||||
|
|
|
@ -12,8 +12,7 @@ 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
|
||||||
|
|
|
@ -16,8 +16,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,8 +19,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,8 +21,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,8 +17,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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 {
|
||||||
}
|
}
|
||||||
|
|
|
@ -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]) ?
|
||||||
|
|
|
@ -52,8 +52,7 @@ 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},
|
||||||
|
@ -68,11 +67,11 @@ export const COMPILER_PROVIDERS: Array<any|Type|{[k: string]: any}|any[]> =
|
||||||
StyleCompiler,
|
StyleCompiler,
|
||||||
ViewCompiler,
|
ViewCompiler,
|
||||||
NgModuleCompiler,
|
NgModuleCompiler,
|
||||||
/*@ts2dart_Provider*/ {provide: CompilerConfig, useValue: new CompilerConfig()},
|
{provide: CompilerConfig, useValue: new CompilerConfig()},
|
||||||
RuntimeCompiler,
|
RuntimeCompiler,
|
||||||
/*@ts2dart_Provider*/ {provide: Compiler, useExisting: RuntimeCompiler},
|
{provide: Compiler, useExisting: RuntimeCompiler},
|
||||||
DomElementSchemaRegistry,
|
DomElementSchemaRegistry,
|
||||||
/*@ts2dart_Provider*/ {provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry},
|
{provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry},
|
||||||
UrlResolver,
|
UrlResolver,
|
||||||
DirectiveResolver,
|
DirectiveResolver,
|
||||||
PipeResolver,
|
PipeResolver,
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -75,8 +75,7 @@ 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',
|
||||||
|
|
|
@ -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...
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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',
|
||||||
|
|
|
@ -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,8 +31,7 @@ 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[]>[]
|
||||||
|
@ -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');
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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); }
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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}: {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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}.
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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(); }
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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[][];
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -71,7 +71,6 @@ export var VIEW_ENCAPSULATION_VALUES =
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* @ts2dart_const
|
|
||||||
*
|
*
|
||||||
* @deprecated Use ComponentMetadata instead.
|
* @deprecated Use ComponentMetadata instead.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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' +
|
||||||
|
|
|
@ -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),
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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),
|
||||||
|
|
|
@ -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]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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');
|
|
||||||
|
|
|
@ -12,8 +12,7 @@ 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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -23,8 +23,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,8 +16,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -19,8 +19,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,8 +18,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,8 +25,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,8 +23,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,8 +16,7 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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]) ?
|
||||||
|
|
|
@ -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 {
|
||||||
}
|
}
|
||||||
|
|
|
@ -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];
|
||||||
|
|
|
@ -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, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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');
|
|
||||||
|
|
|
@ -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[];
|
||||||
|
|
|
@ -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');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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",
|
"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"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -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